Duduche
March 19, 2010, 09:25:45
Hello,
I recently implemented the deviceLost() method in my GrabberListener-derived class, in addition to frameReady(). The trick is that I have two grabbers notifying the same GrabberListener. For this reason I have a critical section that is taken at some point inside my frameReady() method, to avoid concurrent access to the shared structures. I also have to take this same critical section in the deviceLost() callback.
I noticed that I sometimes (not always) get a deadlock when I disconnect a device. So my question is: is there some kind of race condition between the calls to deviceLost() and frameReady()? Should I find a way to let deviceLost() complete without waiting on pending frameReady() calls?
Also, is it ok to make calls to OutputDebugString() for Debugging in these callbacks?
I recently implemented the deviceLost() method in my GrabberListener-derived class, in addition to frameReady(). The trick is that I have two grabbers notifying the same GrabberListener. For this reason I have a critical section that is taken at some point inside my frameReady() method, to avoid concurrent access to the shared structures. I also have to take this same critical section in the deviceLost() callback.
I noticed that I sometimes (not always) get a deadlock when I disconnect a device. So my question is: is there some kind of race condition between the calls to deviceLost() and frameReady()? Should I find a way to let deviceLost() complete without waiting on pending frameReady() calls?
Also, is it ok to make calls to OutputDebugString() for Debugging in these callbacks?