I'm developing using POCO 1.4.5 and VS 2010 C++ unmanaged.
I'm using a TCPServer. I use the default NotificationCenter to implement a pause function. I do a postNotification and each one of the ServerConnection threads has a handler that just sets a flag. This code works fine in all my tests. However, if the current handlers ServerConnection thread is still doing some work it waits for it to finish before exiting. If my worker thread does a postNotification of a different Notification that is handled in a different class and thread I get a deadlock AFTER my handler code exits but BEFORE it returns from the postNotification.
<1> worker A - in job method
<1> worker A - call postNotification(Notification X)
<1> worker B - Notification X handler
<1> worker B - wait for worker B thread to finish its job
<2> worker B - in job method
<2> worker B - call postNotification(Notification Y)
<9> outputter - Notification Y handler
<9> outputter - enqueue stuff
<9> outputter - exit
<2> worker B - never gets back to job method
<1> worker A - never gets back to Notifcation handler
It appears that the notification dispatching is getting hung. Do you think so? Any suggestions on different approach? Event? Asynch? Or a code fix?