On 6/17/22 07:46, Thaddeus Woskowiak wrote:
> I believe threadnotify() should be called from threadmain() to
> properly register the handler in the rendez group

This is incorrect, according to thread(2):

"The thread library depends on all procs
being in the same rendezvous group"

The issue here is that your note handler has to call noted,
you are returning from the handler without actually resuming the program.
You either need to call noted(NCONT) to resume execution or noted(NDFLT)
to stop execution.

An excerpt from notify(2):

"A notification handler must finish either by exiting the
program or by calling noted; if the handler returns the
behavior is undefined and probably erroneous."

So you are indeed observing undefined behavior.


Hope this helps,
moody

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tfa6823048ad90a21-Mfced9ffce2a92c38458048ad
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to