From e16f70f45210294321a88f23c85ac45046577adc Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Sat, 6 Sep 2014 21:32:53 -0400 Subject: add C11 thread functions operating on tss_t and once_flag These all have POSIX equivalents, but aside from tss_get, they all have minor changes to the signature or return value and thus need to exist as separate functions. --- src/thread/tss_create.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/thread/tss_create.c (limited to 'src/thread/tss_create.c') diff --git a/src/thread/tss_create.c b/src/thread/tss_create.c new file mode 100644 index 00000000..251d22b9 --- /dev/null +++ b/src/thread/tss_create.c @@ -0,0 +1,11 @@ +#include + +int __pthread_key_create(tss_t *, void (*)(void *)); + +int tss_create(tss_t *tss, tss_dtor_t dtor) +{ + /* Different error returns are possible. C glues them together into + * just failure notification. Can't be optimized to a tail call, + * unless thrd_error equals EAGAIN. */ + return __pthread_key_create(tss, dtor) ? thrd_error : thrd_success; +} -- cgit 1.4.1