Gyannea
February 27th, 2004, 02:47 PM
Is there a conflict calling SuspendThread() or ResumeThread() if the thread being played with calls the Sleep() function?
I have a thread which scans a radio. All it does at this stage is color an indicator lamp in a window and Sleep 'x' milliseconds before erasing the current lamp and coloring a new one. The process repeats in an infinite "while(1)" loop.
IN another thread if a signal from the radio is found SuspendThread() is called to stop scanning. Depending upon what happens, ResumeThread() may be called to restart the scan. The thread that calls the Resume and Suspend functions occassionally locks up, even though the scanner keeps going. However, taking these lines out stops the lockup.
Neither of these threads involves a window...I think. The thread doing the Suspending/Resuming does involve DirectSound and DirectSoundCapture, but I don't see how any Windows messaging is involved.
Does anyone understand this mess?
Thanks,
Brian
I have a thread which scans a radio. All it does at this stage is color an indicator lamp in a window and Sleep 'x' milliseconds before erasing the current lamp and coloring a new one. The process repeats in an infinite "while(1)" loop.
IN another thread if a signal from the radio is found SuspendThread() is called to stop scanning. Depending upon what happens, ResumeThread() may be called to restart the scan. The thread that calls the Resume and Suspend functions occassionally locks up, even though the scanner keeps going. However, taking these lines out stops the lockup.
Neither of these threads involves a window...I think. The thread doing the Suspending/Resuming does involve DirectSound and DirectSoundCapture, but I don't see how any Windows messaging is involved.
Does anyone understand this mess?
Thanks,
Brian