cpp: Let Monitors share Mutex instances
authorDavid Reiss <dreiss@apache.org>
Tue, 9 Mar 2010 05:19:30 +0000 (05:19 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 9 Mar 2010 05:19:30 +0000 (05:19 +0000)
commitb9db49c6776bde3b06ce8a5ceb32c873f8de4592
treea6925b9e86822ef11fed77eacb2cd50aa0e072d3
parent28e88ecac1cab801112587068ee4fbc6de457e49
cpp: Let Monitors share Mutex instances

- Let Monitor objects share a Mutex() instance so that more than one
  condition can be implemented on top of a single mutex protecting an
  important data structure.
- Make Mutex and Monitor noncopyable
- Add an accessor to Mutex() so the underlying pthread_mutex_t* can be
  retrieved for passing to pthread_condwait
- Change Monitor to use the actual Mutex class instead of creating a
  naked pthread_mutex_t on its own
- Add new constructors to Monitor

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920666 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/concurrency/Monitor.cpp
lib/cpp/src/concurrency/Monitor.h
lib/cpp/src/concurrency/Mutex.cpp
lib/cpp/src/concurrency/Mutex.h