diff options
| author | Michael Bebenita <[email protected]> | 2010-08-09 07:42:06 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-09 07:42:06 -0700 |
| commit | 9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029 (patch) | |
| tree | fc1d740c0715011adbf2169b9b0ad9845d7bc19b /src/rt/sync/sync.cpp | |
| parent | Made the runtime keep track of all live domains and print their state. (diff) | |
| download | rust-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.cpp | 12 |
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 +} |