> Ooops I think that was initially my fault... Like a carelessly discarded
> cigarette butt my comment seems to have sparked a large flame :(
lol, no worries, I've survived worse {:v)
> ...Anyhoo, I'll try and be some assistance about your question rather than
> getting drawn into stylistic arguments. (BTW I wouldn't have any
> problems if
> I had to maintain your code).
(Thankyou!)
> Hmm this was never problem back in the old MS-DOS days :)...
Nor before the task manager showed that little green square in the system
tray! lol
>
> This bit of code seems fine to me, although there's no need for the
> bTerminationComplete flag. You can wait in the main thread for the worker
> thread's handle to become signalled signifying that the thread is truely
> dead.
Understood - I'll use this little snippet of info to remove that redundant
flag.
> I think the problem lies in this routine....
>
> bDone = FALSE ;
>
> // Wait for completion of WaitCommEvent()
>
> while (!rsThreadData.bTerminate && !bDone)
>
> ---> Here is where I think the problem is coming about. According to the
> MSDN:
>
> So instead of sitting in a while loop you should wait on the event handle
> stored inside the overlapped structure. This will enable the
> thread to yield
> until the I/O actually occurs. Then GetOverlappedResult can be used to
> retrieve the information.
I see... I guess I couldn't quite get my head round the MSDN explanation,
but for a first effort I'm not ashamed of what I wrote {;v)
I'll see if that clears up my problem - thanks for looking.
--
Jason Teagle
[EMAIL PROTECTED]
_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for
subscription changes, and list archive.