rt: Remove sync::yield and sync::sleep
This commit is contained in:
parent
421c8db144
commit
5d8d591ffc
1
mk/rt.mk
1
mk/rt.mk
@ -35,7 +35,6 @@ define DEF_RUNTIME_TARGETS
|
||||
|
||||
RUNTIME_CS_$(1) := \
|
||||
rt/sync/timer.cpp \
|
||||
rt/sync/sync.cpp \
|
||||
rt/sync/lock_and_signal.cpp \
|
||||
rt/sync/rust_thread.cpp \
|
||||
rt/rust.cpp \
|
||||
|
@ -1,20 +0,0 @@
|
||||
#include "../globals.h"
|
||||
#include "sync.h"
|
||||
|
||||
void sync::yield() {
|
||||
#ifdef __APPLE__
|
||||
pthread_yield_np();
|
||||
#elif __WIN32__
|
||||
Sleep(1);
|
||||
#else
|
||||
pthread_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
void sync::sleep(size_t timeout_in_ms) {
|
||||
#ifdef __WIN32__
|
||||
Sleep(timeout_in_ms);
|
||||
#else
|
||||
usleep(timeout_in_ms * 1000);
|
||||
#endif
|
||||
}
|
@ -4,8 +4,6 @@
|
||||
|
||||
class sync {
|
||||
public:
|
||||
static void yield();
|
||||
static void sleep(size_t timeout_in_ms);
|
||||
template <class T>
|
||||
static bool compare_and_swap(T *address,
|
||||
T oldValue, T newValue) {
|
||||
|
Loading…
Reference in New Issue
Block a user