[Quickfix-developers] WaitForSingleObject deadlock
Brought to you by:
orenmnero
From: Malinka R. <ael...@gm...> - 2008-12-26 22:25:30
|
while doing some improvements to one of our QF systems, i was running into some deadlocks. one group of which seem to be related to the Windows API call to WaitForSingleObject as a thread join mechanism. however for some reason in this situation, which is unfortunately fairly complicated as I am attempting to extend the functionality of another application by creating a DLL and implementing call backs for the Application to call into and using an API to call into of the applications, which requires that I use the Visual Studio 6 C/C++ compiler to create this DLL, it seems this call is not behaving itself where instead of returning successfully when the thread function returns, it's never returning when called with an INFINITE for the timeout and returns with a timeout error when specified with a timeout, even though the thread in question is returning (logged just before return happens and same exact set of codes works where instead of calling WaitForSingleObject instead at the end of the thread function i set a flag to true signifying completion of thread and then check that flag with a threaded sleep instead of calling WaitForSingleObject). The above solution of course was applied to my application side logic where threading was used, however Quickfix is attempting to make use of the same Windows API call in Utility.cpp in the thread_join function which of course with the above situation is causing any calls to thread_join to hang indefinitely. Does anyone have any ideas why this could be happening and a proper way to solve it? |