From owner-freebsd-questions Sun Sep 23 19:34: 6 2001 Delivered-To: freebsd-questions@freebsd.org Received: from home.com (c1737881-a.plano1.tx.home.com [65.10.46.29]) by hub.freebsd.org (Postfix) with ESMTP id 08D4037B420 for ; Sun, 23 Sep 2001 19:34:03 -0700 (PDT) Received: (from mcbrune@localhost) by home.com (8.11.6/8.11.4) id f8O2XV003913; Sun, 23 Sep 2001 21:33:31 -0500 (CDT) (envelope-from mcbrune) From: mcbrune Message-Id: <200109240233.f8O2XV003913@home.com> Subject: Re: pthread_cond_signal question In-Reply-To: <20010918142842.F12608@cnd.mcgill.ca> To: Mathew Kanner Date: Sun, 23 Sep 2001 21:33:31 -0500 (CDT) Cc: freebsd-questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL92 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Yes, I believe you are correct. The call to pthread_cond_signal will not unblock a thread that is not waiting, and it does not pend the signal either. Corey > Hello All, > I hope that you can help me decifer the pthread and > pthread_cond_signal man pages. > > > -The pthread man page for pthread_cond_signal says: > int pthread_cond_signal(pthread_cond_t *cond) > Unblock at least one of the threads blocked on the > specified condition variable. > > -And the pthread_cond_signal man page says: > DESCRIPTION > The pthread_cond_signal() function unblocks one thread waiting > for the condition variable cond. > > > All is fine if there is at least on thread waiting on the > condition variable. However, if there are no threads waiting, then > the call does not unblock a thread -- this is the behavior that I want > but it differs from the man page. Can I rely on this behavior or am I > missing something subtle? > > Thanks, > --Mat > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message