Date: Thu, 12 Mar 2009 10:36:39 +0000 (UTC) From: Bruce M Simpson <bms@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r189736 - head/sys/kern Message-ID: <200903121036.n2CAadQA028198@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bms Date: Thu Mar 12 10:36:39 2009 New Revision: 189736 URL: http://svn.freebsd.org/changeset/base/189736 Log: Ensure that the semaphore value is re-checked after sem_lock is re-acquired, after the condition variable is signalled. PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 MFC after: 5 days Reviewed by: attilio Modified: head/sys/kern/uipc_sem.c Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Thu Mar 12 10:34:16 2009 (r189735) +++ head/sys/kern/uipc_sem.c Thu Mar 12 10:36:39 2009 (r189736) @@ -727,7 +727,7 @@ kern_sem_wait(struct thread *td, semid_t #endif DP(("kern_sem_wait value = %d, tryflag %d\n", ks->ks_value, tryflag)); vfs_timestamp(&ks->ks_atime); - if (ks->ks_value == 0) { + while (ks->ks_value == 0) { ks->ks_waiters++; if (tryflag != 0) error = EAGAIN;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903121036.n2CAadQA028198>