summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/include/pthread.h
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2012-05-03 09:07:17 +0000
committerpirofti <pirofti@openbsd.org>2012-05-03 09:07:17 +0000
commit5037ac1448f12df9d6bb181cf8264de46cdbfcf8 (patch)
tree83a9c180f50bc1d65b2a0f7ba19a64f1491cbb94 /lib/libpthread/include/pthread.h
parentOops, previous change had some unrelated changes that shouldn't have been (diff)
downloadwireguard-openbsd-5037ac1448f12df9d6bb181cf8264de46cdbfcf8.tar.xz
wireguard-openbsd-5037ac1448f12df9d6bb181cf8264de46cdbfcf8.zip
Add pthread spinlock support.
Implementation, documentation and naive regression tests for: - pthread_spin_init() - pthread_spin_destroy() - pthread_spin_lock() - pthread_spin_trylock() - pthread_spin_unlock() Implementation okay guenther@, documentation okay jmc@.
Diffstat (limited to 'lib/libpthread/include/pthread.h')
-rw-r--r--lib/libpthread/include/pthread.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libpthread/include/pthread.h b/lib/libpthread/include/pthread.h
index c21f753de12..0fc9f375516 100644
--- a/lib/libpthread/include/pthread.h
+++ b/lib/libpthread/include/pthread.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pthread.h,v 1.35 2012/04/14 12:07:49 kurt Exp $ */
+/* $OpenBSD: pthread.h,v 1.36 2012/05/03 09:07:17 pirofti Exp $ */
/*
* Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
@@ -136,6 +136,7 @@ typedef struct pthread_rwlock *pthread_rwlock_t;
typedef struct pthread_rwlockattr *pthread_rwlockattr_t;
typedef struct pthread_barrier *pthread_barrier_t;
typedef struct pthread_barrierattr *pthread_barrierattr_t;
+typedef struct pthread_spinlock *pthread_spinlock_t;
/*
* Additional type definitions:
@@ -318,6 +319,11 @@ int pthread_barrierattr_init(pthread_barrierattr_t *);
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
int pthread_barrierattr_getpshared(pthread_barrierattr_t *, int *);
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
+int pthread_spin_init(pthread_spinlock_t *, int);
+int pthread_spin_destroy(pthread_spinlock_t *);
+int pthread_spin_trylock(pthread_spinlock_t *);
+int pthread_spin_lock(pthread_spinlock_t *);
+int pthread_spin_unlock(pthread_spinlock_t *);
__END_DECLS
#endif /* _PTHREAD_H_ */