From owner-freebsd-current Tue Feb 29 19:51:22 2000 Delivered-To: freebsd-current@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 3795C37BDA6 for ; Tue, 29 Feb 2000 19:51:17 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id WAA21148; Tue, 29 Feb 2000 22:50:58 -0500 (EST) Date: Tue, 29 Feb 2000 22:50:57 -0500 (EST) From: Daniel Eischen To: John Polstra Cc: current@FreeBSD.ORG Subject: Re: pthread_{suspend,resume}_np broken? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 29 Feb 2000, John Polstra wrote: > Either pthread_suspend_np() and pthread_resume_np() are broken in > -current or I don't understand them. The attached program (cc > -pthread suspend.c) starts two background threads. Each thread loops > outputting a character ('1' or '2' according to which thread it is) > and then sleeping for a second. Meanwhile, the main thread reads > keypresses from the standard input. On each keypress it toggles > background thread 1 between suspended and resumed. [...] > Shouldn't the test against PS_SUSPENDED be "==" instead of "!="? I > would think we'd want to do something if the thread was suspended, and > skip it if the thread wasn't suspended -- exactly the opposite of what > the current code does. Yes, it should be "==" instead of "!=". Go ahead and fix it if you want :-) Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message