Subject: [Boost-bugs] [Boost C++ Libraries] #7586: Add a testable_mutex
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-28 19:22:13
#7586: Add a testable_mutex
------------------------------+---------------------------------------------
Reporter: viboes | Owner: viboes
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
Based on Associate Mutexes with Data to Prevent Races, By Herb Sutter, May
13, 2010 - http://www.drdobbs.com/windows/associate-mutexes-with-data-to-
prevent-r/224701827?pgno=3
"Make our mutex testable if it isn't already.
Many mutex services (including boost::mutex) don't provide a way to ask,
"Do I already hold a lock on this mutex?"
Sometimes it is needed to know if a method like is_held to be available.
This wrapper associates an arbitrary lockable type with a thread id that
stores the ID of the thread that currently holds the lockable. The thread
id initially holds an invalid value that means no threads own the mutex.
When we acquire a lock, we set the thread id; and when we release a lock,
we reset it back to its default no id state."
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7586> 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:11 UTC