From owner-cvs-all Tue Aug 21 11:42:50 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 00D0437B409; Tue, 21 Aug 2001 11:42:47 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7LIgkp03186; Tue, 21 Aug 2001 11:42:46 -0700 (PDT) (envelope-from jhb) Message-Id: <200108211842.f7LIgkp03186@freefall.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2001 11:42:46 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_condvar.c kern_synch.c src/sys/sys proc.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG jhb 2001/08/21 11:42:46 PDT Modified files: sys/kern kern_condvar.c kern_synch.c sys/sys proc.h Log: - Fix a bug in the previous workaround for the tsleep/endtsleep race. callout_stop() would fail in two cases: 1) The timeout was currently executing, and 2) The timeout had already executed. We only needed to work around the race for 1). We caught some instances of 2) via the PS_TIMEOUT flag, however, if endtsleep() fired after the process had been woken up but before it had resumed execution, PS_TIMEOUT would not be set, but callout_stop() would fail, so we would block the process until endtsleep() resumed it. Except that endtsleep() had already run and couldn't resume it. This adds a new flag PS_TIMOFAIL to indicate the case of 2) when PS_TIMEOUT isn't set. - Implement this race fix for condition variables as well. Tested by: sos Revision Changes Path 1.12 +29 -7 src/sys/kern/kern_condvar.c 1.156 +6 -3 src/sys/kern/kern_synch.c 1.175 +2 -1 src/sys/sys/proc.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message