Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2013 19:26:55 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Joe Marcus Clarke <marcus@marcuscom.com>, Daniel Eischen <deischen@FreeBSD.org>
Cc:        Koop Mast <kwm@rainbow-runner.nl>, freebsd-threads@FreeBSD.org
Subject:   Re: Mutexes and error checking
Message-ID:  <51EC0BCF.6080501@FreeBSD.org>
In-Reply-To: <20130721160220.GA38417@stack.nl>
References:  <51E71D4F.5030502@marcuscom.com> <Pine.GSO.4.64.1307181059460.22570@sea.ntplx.net> <51E8061B.60906@marcuscom.com> <Pine.GSO.4.64.1307181118100.22570@sea.ntplx.net> <Pine.GSO.4.64.1307182144030.23634@sea.ntplx.net> <Pine.GSO.4.64.1307190152440.25756@sea.ntplx.net> <51EB5EC4.6050802@marcuscom.com> <20130721160220.GA38417@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
on 21/07/2013 19:02 Jilles Tjoelker said the following:
> So I think allowing pthread_mutex_unlock() by a different thread would
> be a step backwards.

There is something else that bothers me too.
Properly written code always "knows" whether it has a lock or not.  It does not
try to unlock on a whim.  Apparently the software in question is not properly
written.  Nevertheless, it takes care to check return status of
pthread_mutex_unlock().  And, to add insult to injury, it depends on OS-specific
behavior in doing so.  That seems like "two wrongs make a right" thing.

I understand that "life is such", etc, but it hurts to see us bend for such a
backwards code.

-- 
Andriy Gapon



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