pthread's - check for running thread

This is a discussion on pthread's - check for running thread within the Linux Programming forums, part of the Platform Specific Boards category; To create a thread one uses pthread_create. To terminate it, pthread_cancel, to wait for it's termination pthread_join... but how do ...

  1. #1
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722

    pthread's - check for running thread

    To create a thread one uses pthread_create. To terminate it, pthread_cancel, to wait for it's termination pthread_join... but how do we check if a thread has exit, (or not) by it's id, without blocking on the function's call ?
    In windows it would be WaitForSignleObject(thread_handle,0)
    Last edited by xErath; 05-29-2005 at 01:03 PM.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,660

  3. #3
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722
    the cleanup stuff gave me a good ideia.. instead of calling the thread function, I'll call my own function which calls the thread function. And mine will then signal a var.
    Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. allegro issues
    By mramazing in forum C++ Programming
    Replies: 1
    Last Post: 01-07-2009, 10:56 PM
  2. Replies: 2
    Last Post: 07-01-2007, 07:11 AM
  3. Messaging Between Threads, Exiting Thread On Demand, Etc.
    By HyperShadow in forum C++ Programming
    Replies: 10
    Last Post: 06-09-2007, 01:04 PM
  4. C++ Threading?
    By draggy in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2005, 12:16 PM
  5. Replies: 12
    Last Post: 05-17-2003, 05:58 AM

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