Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Oct 98 09:42:02 -0500
From:      "Richard Seaman, Jr." <lists@tar.com>
To:        "Daniel Eischen" <eischen@vigrid.com>
Cc:        "current@freebsd.org" <current@FreeBSD.ORG>
Subject:   Re: Another Serious libc_r problem
Message-ID:  <199810211442.JAA20186@ns.tar.com>

next in thread | raw e-mail | index | archive | help
On Wed, 21 Oct 1998 09:18:22 -0400 (EDT), Daniel Eischen wrote:

>> The condition can only be signaled when
>> the condition spinlock is not held.  So... why wouldn't you hold the
>> condition spinlock as long as possible (ie. after the mutex unlock)
>> and *then* set _thread_kern_in_sched = 1 after all the spinlocks have
>> been done?
>
>If the thread doesn't own the mutex, then you've got the
>condition variable locked while you're waiting for the
>pthread_mutex_unlock().  Since this falls into the category
>of "undefined behavior" it probably doesn't matter though.

However, the thread should own the mutex shouldn't it?  I thought
the spec for pthread_cond_wait says it should return EINVAL if
the thread doesn't own the mutex?  However, its not clear to
me that our pthread_cond_wait code makes this check (I think
it doesn't).



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810211442.JAA20186>