]> pd.if.org Git - pdclib.old/blobdiff - platform/win32/functions/threads/tss_set.c
win32: initial pass at thread support
[pdclib.old] / platform / win32 / functions / threads / tss_set.c
diff --git a/platform/win32/functions/threads/tss_set.c b/platform/win32/functions/threads/tss_set.c
new file mode 100644 (file)
index 0000000..5ab53f1
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef REGTEST\r
+#include <threads.h>\r
+#include <windows.h>\r
+\r
+int tss_set(tss_t key, void *val)\r
+{\r
+    if(TlsSetValue(key->_Key, val))\r
+        return thrd_success;\r
+    return thrd_error;\r
+}\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+/* Tested in tss_get.c */\r
+int main( void )\r
+{\r
+    return TEST_RESULTS;\r
+}\r
+\r
+#endif
\ No newline at end of file