Removed what seems to be the last of the calls to rand(). Closes #582.
This commit is contained in:
parent
066bcc6c79
commit
111989a626
@ -19,10 +19,6 @@ void sync::sleep(size_t timeout_in_ms) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void sync::random_sleep(size_t max_timeout_in_ms) {
|
||||
sleep(rand() % max_timeout_in_ms);
|
||||
}
|
||||
|
||||
rust_thread::rust_thread() : _is_running(false), thread(0) {
|
||||
// Nop.
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ class sync {
|
||||
public:
|
||||
static void yield();
|
||||
static void sleep(size_t timeout_in_ms);
|
||||
static void random_sleep(size_t max_timeout_in_ms);
|
||||
template <class T>
|
||||
static bool compare_and_swap(T *address,
|
||||
T oldValue, T newValue) {
|
||||
|
@ -15,7 +15,7 @@ rust_domain_test::worker::run() {
|
||||
for (int i = 0; i < TASKS; i++) {
|
||||
handle->create_task(NULL, "child");
|
||||
}
|
||||
sync::random_sleep(1000);
|
||||
sync::sleep(rand(&handle->rctx) % 1000);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -62,6 +62,6 @@ rust_task_test::run() {
|
||||
worker->start();
|
||||
}
|
||||
|
||||
sync::random_sleep(1000);
|
||||
sync::sleep(rand(&kernel.sched->rctx) % 1000);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user