This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_mutex_destroy returns EBUSY, but the mutex isn't locked


Hi Carlos,

Thanks, but that seems unlikely for a reason I forgot to mention: all
threads except the main thread have been successfully joined *before*
I attempt to destroy any of the mutexes. In addition, I never create
more than three additional threads for this algorithm (I'm running on
a quad-core machine and the main thread remains active) and I'm
occasionally seeing nusers go as high as 10.

Thanks,
Adrian

On Wed, Jun 4, 2008 at 10:11 AM, Carlos O'Donell
<carlos@systemhalted.org> wrote:
> On Wed, Jun 4, 2008 at 8:48 AM, Adrian Ludwin <adrian.ludwin@gmail.com> wrote:
>>      Mutex 0x920df0: lock=0, count=0, owner=0, nusers=2, kind=2
>
> The mutex is unlocked, there are 2 waiters on the futex, but they
> haven't had time to be woken yet, therefore you can't destroy the
> mutex, and calls to pthread_mutex_destroy() return EBUSY.
>
> You shouldn't ignore the error. You should wait a while and try
> destroying it again.
>
> Cheers,
> Carlos.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]