Removed what seems to be the last of the calls to rand(). Closes #582.

This commit is contained in:
Eric Holk 2011-07-06 11:49:52 -07:00
parent 066bcc6c79
commit 111989a626
3 changed files with 2 additions and 7 deletions

View File

@ -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.
}

View File

@ -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) {

View File

@ -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;
}