Highlighted
Absent Member.
Absent Member.
905 views

Cancelling a thread

Jump to solution

I want to send a message to a thread to close and am attempting to use the CBL_THREAD_IDDATA_ALLOC and CBL_THREAD_IDDATA_GET routines. I am am getting an exception error when calling CBL_THREAD_IDDATA_GET after creating the and the intellisense is saying there is no routine with this signature. I was going by the example from the documentation. I then created a new project using the example exactly as written and I get the same error. Is there a bug in this approach?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Cancelling a thread

Jump to solution

This is the same bug that Robert pointed out on your previous post.

It has to do with the usage thread-pointer not being mapped correctly to a .NET IntPtr data type which is required under the covers.

If you change the call so that it uses an IntPtr it should work OK.

        01 sub-handle       usage thread-pointer.

        01  IntPtr type System.IntPtr.

              set IntPtr to sub-handle as type System.IntPtr

              call 'CBL_THREAD_IDDATA_GET' using sub-iddata-ptr

                                by value IntPtr

             ...

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Cancelling a thread

Jump to solution

This is the same bug that Robert pointed out on your previous post.

It has to do with the usage thread-pointer not being mapped correctly to a .NET IntPtr data type which is required under the covers.

If you change the call so that it uses an IntPtr it should work OK.

        01 sub-handle       usage thread-pointer.

        01  IntPtr type System.IntPtr.

              set IntPtr to sub-handle as type System.IntPtr

              call 'CBL_THREAD_IDDATA_GET' using sub-iddata-ptr

                                by value IntPtr

             ...

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Cancelling a thread

Jump to solution

Thanks Chris

I thought i had tried that in my program, but I guess I didn't. Thanks again fro your help. If you know of an easier way for two threads to communicate please let me know.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.