PERFORCE change 95272 for review
John Birrell
jb at FreeBSD.org
Fri Apr 14 21:28:30 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=95272
Change 95272 by jb at jb_freebsd2 on 2006/04/14 21:28:11
Add some more compatibility cruft.
Affected files ...
.. //depot/projects/dtrace/src/contrib/opensolaris/compat/thread.h#2 edit
Differences ...
==== //depot/projects/dtrace/src/contrib/opensolaris/compat/thread.h#2 (text+ko) ====
@@ -30,6 +30,7 @@
#define _OPENSOLARIS_COMPAT_THREAD_H_
#include <pthread.h>
+#include <pthread_np.h>
#include <opensolaris/compat/sys/synch.h>
typedef int thread_key_t;
@@ -37,4 +38,20 @@
typedef struct pthread_mutex *mutex_t;
typedef struct pthread_rwlock *rwlock_t;
+#define mutex_lock pthread_mutex_lock
+#define mutex_unlock pthread_mutex_unlock
+#define mutex_init(_a,_b,_c) pthread_mutex_init(_a,_c)
+#define rwlock_init(_a,_b,_c) pthread_rwlock_init(_a,_c)
+#define rw_rdlock pthread_rwlock_rdlock
+#define rw_wrlock pthread_rwlock_wrlock
+#define rw_unlock pthread_rwlock_unlock
+#define thr_keycreate pthread_key_create
+#define thr_setspecific pthread_setspecific
+#define thr_main pthread_main_np
+#define _mutex_held(_a) pthread_mutex_held_np(_a)
+#define MUTEX_HELD(_a) pthread_mutex_held_np(_a)
+#define RW_READ_HELD(_a) pthread_rwlock_rdheld_np(_a)
+#define RW_WRITE_HELD(_a) pthread_rwlock_wrheld_np(_a)
+#define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x))
+
#endif
More information about the p4-projects
mailing list