diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-09-05 02:40:56 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-09-05 02:40:56 +0000 |
commit | cccbd286e927a6a92e8f7231e57ddd17a243314f (patch) | |
tree | 41eff3ba3c242fab3369fa5a3338b606e3212e48 /lib/libc/hidden | |
parent | 1fb8297ae3c4f75c7a5d87d15fc92ba8fa2cbbdc (diff) |
Move mutex, condvar, and thread-specific data routes, pthread_once, and
pthread_exit from libpthread to libc, along with low-level bits to
support them. Major bump to both libc and libpthread.
Requested by libressl team. Ports testing by naddy@
ok kettenis@
Diffstat (limited to 'lib/libc/hidden')
-rw-r--r-- | lib/libc/hidden/machine/spinlock.h | 27 | ||||
-rw-r--r-- | lib/libc/hidden/pthread.h | 27 |
2 files changed, 52 insertions, 2 deletions
diff --git a/lib/libc/hidden/machine/spinlock.h b/lib/libc/hidden/machine/spinlock.h new file mode 100644 index 00000000000..26a7c30b265 --- /dev/null +++ b/lib/libc/hidden/machine/spinlock.h @@ -0,0 +1,27 @@ +/* $OpenBSD: spinlock.h,v 1.1 2017/09/05 02:40:54 guenther Exp $ */ +/* + * Copyright (c) 2017 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_MACHINE_SPINLOCK_H_ +#define _LIBC_MACHINE_SPINLOCK_H_ + +#include_next <machine/spinlock.h> + +__BEGIN_HIDDEN_DECLS +int _atomic_lock(volatile _atomic_lock_t *); +__END_HIDDEN_DECLS + +#endif /* !_LIBC_MACHINE_SPINLOCK_H_ */ diff --git a/lib/libc/hidden/pthread.h b/lib/libc/hidden/pthread.h index c390753a1c2..534020101c5 100644 --- a/lib/libc/hidden/pthread.h +++ b/lib/libc/hidden/pthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread.h,v 1.1 2015/11/10 04:14:03 guenther Exp $ */ +/* $OpenBSD: pthread.h,v 1.2 2017/09/05 02:40:54 guenther Exp $ */ /* * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> * @@ -20,6 +20,29 @@ #include_next <pthread.h> -PROTO_DEPRECATED(pthread_atfork); +PROTO_STD_DEPRECATED(pthread_atfork); +PROTO_STD_DEPRECATED(pthread_cond_broadcast); +PROTO_STD_DEPRECATED(pthread_cond_destroy); +PROTO_NORMAL(pthread_cond_init); +PROTO_STD_DEPRECATED(pthread_cond_signal); +PROTO_STD_DEPRECATED(pthread_cond_timedwait); +PROTO_STD_DEPRECATED(pthread_cond_wait); +PROTO_STD_DEPRECATED(pthread_condattr_destroy); +PROTO_STD_DEPRECATED(pthread_condattr_getclock); +PROTO_STD_DEPRECATED(pthread_condattr_init); +PROTO_STD_DEPRECATED(pthread_condattr_setclock); +PROTO_NORMAL(pthread_exit); +PROTO_NORMAL(pthread_getspecific); +PROTO_NORMAL(pthread_key_create); +PROTO_STD_DEPRECATED(pthread_key_delete); +PROTO_NORMAL(pthread_mutex_destroy); +PROTO_NORMAL(pthread_mutex_init); +PROTO_NORMAL(pthread_mutex_lock); +PROTO_STD_DEPRECATED(pthread_mutex_timedlock); +PROTO_STD_DEPRECATED(pthread_mutex_trylock); +PROTO_NORMAL(pthread_mutex_unlock); +PROTO_STD_DEPRECATED(pthread_once); +PROTO_NORMAL(pthread_self); +PROTO_NORMAL(pthread_setspecific); #endif /* !_LIBC_PTHREAD_H_ */ |