aboutsummaryrefslogtreecommitdiffstats
path: root/include/pthread.h
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-10-18 05:09:22 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-10-18 05:09:22 +0000
commita6b9b59e0486667a43fda2ab77a7a053c820c2d9 (patch)
tree5d87e55da61d90b4464bf03c36f9afc2bd9e16aa /include/pthread.h
parente25daafbb68ed084aa9861e42691a09a4242d7d0 (diff)
downloadsrc-a6b9b59e0486667a43fda2ab77a7a053c820c2d9.tar.gz
src-a6b9b59e0486667a43fda2ab77a7a053c820c2d9.zip
Add pthread_rwlockattr_setkind_np and pthread_rwlockattr_getkind_np, the
functions set or get pthread_rwlock type, current supported types are: PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, default is PTHREAD_RWLOCK_PREFER_WRITER_NONCECURSIVE_NP, this maintains binary compatible with old code.
Notes
Notes: svn path=/head/; revision=214007
Diffstat (limited to 'include/pthread.h')
-rw-r--r--include/pthread.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/pthread.h b/include/pthread.h
index 56f6ef4de4eb..9a8e2ae1f047 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -135,6 +135,15 @@ enum pthread_mutextype {
#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
+enum pthread_rwlocktype_np
+{
+ PTHREAD_RWLOCK_PREFER_READER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NP,
+ PTHREAD_RWLOCK_DEFAULT_NP =
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
+};
+
struct _pthread_cleanup_info {
__uintptr_t pthread_cleanup_pad[8];
};
@@ -233,11 +242,14 @@ int pthread_rwlock_tryrdlock(pthread_rwlock_t *);
int pthread_rwlock_trywrlock(pthread_rwlock_t *);
int pthread_rwlock_unlock(pthread_rwlock_t *);
int pthread_rwlock_wrlock(pthread_rwlock_t *);
-int pthread_rwlockattr_init(pthread_rwlockattr_t *);
+int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
+int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
+ int *);
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
int *);
+int pthread_rwlockattr_init(pthread_rwlockattr_t *);
+int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int);
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
-int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
pthread_t pthread_self(void);
int pthread_setspecific(pthread_key_t, const void *);