aboutsummaryrefslogtreecommitdiff
path: root/src/rt/sync/sync.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-09 07:42:06 -0700
committerMichael Bebenita <[email protected]>2010-08-09 07:42:06 -0700
commit9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029 (patch)
treefc1d740c0715011adbf2169b9b0ad9845d7bc19b /src/rt/sync/sync.cpp
parentMade the runtime keep track of all live domains and print their state. (diff)
downloadrust-9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029.tar.xz
rust-9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029.zip
Added class to abstract away platform specific thread primitives.
Diffstat (limited to 'src/rt/sync/sync.cpp')
-rw-r--r--src/rt/sync/sync.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rt/sync/sync.cpp b/src/rt/sync/sync.cpp
new file mode 100644
index 00000000..eba51a49
--- /dev/null
+++ b/src/rt/sync/sync.cpp
@@ -0,0 +1,12 @@
+#include "../globals.h"
+#include "sync.h"
+
+void sync::yield() {
+#ifdef __APPLE__
+ pthread_yield_np();
+#elif __WIN32__
+
+#else
+ pthread_yield();
+#endif
+}