socsvn commit: r238801 - in soc2012/gmiller/locking-head: .
lib/libwitness
gmiller at FreeBSD.org
gmiller at FreeBSD.org
Mon Jul 2 13:09:40 UTC 2012
Author: gmiller
Date: Mon Jul 2 13:09:38 2012
New Revision: 238801
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238801
Log:
r238614 at FreeBSD-dev: root | 2012-06-29 14:49:12 -0500
Add wrappers for the remaining mutex locking functions.
Modified:
soc2012/gmiller/locking-head/ (props changed)
soc2012/gmiller/locking-head/lib/libwitness/wrappers.c
Modified: soc2012/gmiller/locking-head/lib/libwitness/wrappers.c
==============================================================================
--- soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Mon Jul 2 13:09:28 2012 (r238800)
+++ soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Mon Jul 2 13:09:38 2012 (r238801)
@@ -28,6 +28,9 @@
#include "witness.h"
int _pthread_mutex_lock(pthread_mutex_t *mutex);
+int _pthread_mutex_trylock(pthread_mutex_t *mutex);
+int _pthread_mutex_timedlock(pthread_mutex_t *mutex,
+ const struct timespec *ts);
int _pthread_mutex_unlock(pthread_mutex_t *mutex);
pthread_mutex_t witness_mtx = PTHREAD_MUTEX_INITIALIZER;
@@ -46,6 +49,32 @@
}
int
+pthread_mutex_trylock(pthread_mutex_t *mutex)
+{
+ int ret;
+
+ ret = _pthread_mutex_trylock(mutex);
+ if (mutex != &witness_mtx && ret == 0) {
+ add_lock(mutex);
+ }
+
+ return (ret);
+}
+
+int
+pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *ts)
+{
+ int ret;
+
+ ret = _pthread_mutex_timedlock(mutex, ts);
+ if (mutex != &witness_mtx && ret == 0) {
+ add_lock(mutex);
+ }
+
+ return (ret);
+}
+
+int
pthread_mutex_unlock(pthread_mutex_t *mutex)
{
int ret;
More information about the svn-soc-all
mailing list