I am calling SEM_pend(handle, -1) with a TSK_Handle returned by TSK_Create. The SEM_pend returns immediately. Checking SEM_count on the handle returns a value of 1. Is a handle from TSK_Create a valid object to block on? I want to use the thread's existence/destruction to signal that I can free up resources. I'd like to avoid creating a semaphore if I can use the thread handle.
My main code creates some memory objects and then creates a worker thread that will use those objects. At some point the main thread needs to stop the worker thread and clean up the memory objects. On the PC I am able to use WaitForSingleObject(handle, -1) using the worker thread's handle to block the main thread until the worker thread exits. I do not to adjust the count value of the thread handle. I thought I had used this technique in another part of my code with earlier versions of DSP BIOS. With 5.31.02 the SEM_pend does not block. Is this a change in DSP BIOS?
If I call SEM_reset on the tsk handle before the SEM_pend then the call blocks. When the worker thread terminates, will the main thread unblock?
Thanks,
-Steve