Results 1 to 2 of 2

Thread: Closing A Thread (Multithreading)

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341

    Closing A Thread (Multithreading)

    I have created a thread using _beginthread(), as shown below:

    Code:
    unsigned long m_thread;
    m_thread = _beginthread(control, 0, 0);
    the standard way of closing threads created like this is via _endthread()

    the only problem is i want to close this thread from another thread, so i cannot us that function as it ends the thread that its called from.

    How can i do such ?

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    Well my problem is that i have a thread that gets started fine. THis thread then uses winsock, the problem is that winsock can freeze up and loop for ages thus the thread doesnt stop.

    I need to be able to close the thread when it breaks like this.

    Is there any way i can get a handle to the thread to then use CloseHandle() ??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width