Re: [Boost-bugs] [Boost C++ Libraries] #8306: named mutex does not unlock as expected

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8306: named mutex does not unlock as expected
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-18 19:23:32


#8306: named mutex does not unlock as expected
--------------------------------------------------------+-------------------
  Reporter: David Hebbeker <david.hebbeker@…> | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.52.0 | Severity: Optimization
Resolution: | Keywords: named mutex, named_mutex, semaphore, posix_named_semaphore, unlock
--------------------------------------------------------+-------------------

Comment (by steven_watanabe):

 I don't understand why you expect this behavior. Your quote from
 Tanenbaum is irrelevant because valid states only apply as long as you
 follow the rules. Once you break the rules, all bets are off.

 {{{
 $ man pthread_mutex_unlock
 ...
 If the mutex type is PTHREAD_MUTEX_DEFAULT, ... Attempting to
 unlock the mutex if it was not locked by the calling thread
 results in undefined behavior. Attempting to ulock the mutex
 if it is not locked results in undefined behavior.
 ...
 }}}

 In any case, the precondition that you propose, "no other thread must have
 exclusive ownership of the mutex", is basically useless. If the current
 thread doesn't hold the mutex, how do you know that no other thread holds
 it?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8306#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC