epics mutex now used in named lock pattern

This commit is contained in:
Gasper Jansa
2011-01-09 20:15:00 +01:00
parent 8644741cfa
commit e26e05bfbf
4 changed files with 46 additions and 27 deletions
+10 -1
View File
@@ -11,6 +11,7 @@
#include <string.h>
#include <errno.h>
#include <lock.h>
#include <pvType.h>
#include <epicsAssert.h>
@@ -42,9 +43,15 @@ public:
/**
* Attempt to acquire lock.
*
* NOTE: Argument msecs is currently not supported due to
* Darwin OS not supporting pthread_mutex_timedlock. May be changed in the future.
*
* @param msecs the number of milleseconds to wait.
* An argument less than or equal to zero means not to wait at all.
*
* @return <code>true</code> if acquired, <code>false</code> otherwise.
* NOTE: currently this routine always returns true. Look above for explanation.
*
*/
bool acquire(int64 msecs);
/**
@@ -65,7 +72,9 @@ public:
int decrement();
private:
int _references;
pthread_mutex_t _mutex;
Mutex _mutex;
Mutex _countMutex;
//pthread_mutex_t _mutex;
};