Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everybody, I wan to use pthread_cancel to cancel a thread, but before do that thing i want to check that thread was created or is it running? I dont ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    1

    Check a created thread


    Hi everybody,
    I wan to use pthread_cancel to cancel a thread, but before do that thing i want to check that thread was created or is it running?
    I dont find out the function to check status of a thread.
    How can i do that, please help me.

    Thanks.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,746
    Why not just cancel the thread ID? It will return the ESRCH error if the thread has either not been created or if it is no longer running.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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