Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 1998 19:37:41 -0400 (AST)
From:      The Hermit Hacker <scrappy@hub.org>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   pthread_cancel() function...
Message-ID:  <Pine.BSF.4.05.9812011933460.25036-100000@thelab.hub.org>

next in thread | raw e-mail | index | archive | help

I'm working on getting acapd compiled under FreeBSD, and have hit a snag.
It uses pthread_cancel():

=============================
    /*
     * At this point, current_thread should point to the pthread_t which
     * would've contained the id of the thread we failed to create.
     */
    for (cleanup_thread = (*queue)->thread_ids + concurrency - 1;
         current_thread < cleanup_thread;
         cleanup_thread--)
      pthread_cancel(*cleanup_thread);

    /* Now that they're all canceled, we wait for them to finish. */
    for (cleanup_thread = (*queue)->thread_ids + concurrency;
         current_thread < cleanup_thread;
         cleanup_thread--)
      pthread_join(*cleanup_thread, &status);
    /*
     * Now that they're all finished and not accessing our queue, we can
get     * on with mopping things up...
     */
  }
=============================

The closest I can find is pthread_detach(), but according to the man page for pthread_cancel under Solaris, tehy aren't quite the same...

Anyone with experience with this that can comment?

Thanks..

Marc G. Fournier                                
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9812011933460.25036-100000>