]> pd.if.org Git - pdclib.old/blobdiff - opt/pthreads/tss_create.c
pthread c11 threading backend: add support for thread specific data
[pdclib.old] / opt / pthreads / tss_create.c
diff --git a/opt/pthreads/tss_create.c b/opt/pthreads/tss_create.c
new file mode 100644 (file)
index 0000000..e51a09e
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef REGTEST
+#include <threads.h>
+#include <pthread.h>
+
+int tss_create(tss_t *key, tss_dtor_t dtor)
+{
+    switch(pthread_key_create(key, dtor)) {
+    case 0:
+        return thrd_success;
+    default:
+        return thrd_error;
+    }
+}
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+/* Tested in tss_get.c */
+int main( void )
+{
+    return TEST_RESULTS;
+}
+
+#endif