Terminating blocked thread (MS VC++)

This is a discussion on Terminating blocked thread (MS VC++) within the C++ Programming forums, part of the General Programming Boards category; I have a thread which is blocked on 'WaitCommEvent' . The port has been openned in non-overlapped mode. How do ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    3

    Terminating blocked thread (MS VC++)

    I have a thread which is blocked on 'WaitCommEvent' . The port has been openned in non-overlapped mode. How do I terminate this thread?

    Thanks,

    Ivan.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,673
    The only way to do it cleanly is to use overlapped i/o so that you can wait on multiple handles. Then if you need to exit the thread before the overlapped i/o completes, you can call CancelIo().

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to make a thread sleep or std::recv timeout?
    By BrianK in forum Linux Programming
    Replies: 3
    Last Post: 02-26-2003, 09:27 PM
  2. Multithreading
    By Cela in forum Windows Programming
    Replies: 13
    Last Post: 01-15-2003, 02:02 PM
  3. Your Best thread and your most stupid thread ??
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 01-03-2003, 06:41 PM
  4. MFC Controls and Thread Safety :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 10:36 AM
  5. Multi-Thread Programming
    By drdroid in forum C++ Programming
    Replies: 6
    Last Post: 04-04-2002, 01:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21