Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2013 18:02:20 +0200
From:      Jilles Tjoelker <>
To:        Joe Marcus Clarke <>
Cc:        Daniel Eischen <>, Koop Mast <>,
Subject:   Re: Mutexes and error checking
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Sun, Jul 21, 2013 at 12:08:36AM -0400, Joe Marcus Clarke wrote:
> On 7/19/13 1:55 AM, Daniel Eischen wrote:
> > It seems Solaris behaves like Linux with PTHREAD_MUTEX_NORMAL
> > and _unlocking_ mutexes owned by other threads (dead or not).
> > Solaris only returns EPERM for PTHREAD_MUTEX_ERRORCHECK
> > mutexes.

> Given that, should we do the same?

According to, it seems
like glibc wants to change behaviour here. If a mutex is implemented via
some sort of transactional memory, it may not work correctly if the
mutex is used as a semaphore with a different thread unlocking it. In
particular, attempting to commit a transaction via the XEND instruction
will cause a general protection fault if no transaction is in progress.
Adding software checks against these conditions will use up valuable
transactional memory tracking space.

So I think allowing pthread_mutex_unlock() by a different thread would
be a step backwards.

Jilles Tjoelker

Want to link to this message? Use this URL: <>