diff options
| author | Michael Bebenita <mbebenita@mozilla.com> | 2010-08-09 07:42:06 -0700 |
|---|---|---|
| committer | Michael Bebenita <mbebenita@mozilla.com> | 2010-08-09 07:42:06 -0700 |
| commit | 9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029 (patch) | |
| tree | fc1d740c0715011adbf2169b9b0ad9845d7bc19b /src/rt/sync/sync.cpp | |
| parent | 56cd4e458a6c3cd40a8ee2ceb0a0fdab0352bf20 (diff) | |
| download | rust-9ff6a3d031d2ffaf2863e2a866f7a96ed7ddd029.tar.gz 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 00000000000..eba51a49dfc --- /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 +} |
