File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ rust_scheduler::start_main_loop() {
197
197
DLOG (this , task,
198
198
" all tasks are blocked, scheduler id %d yielding ..." ,
199
199
id);
200
- lock.timed_wait (100000 );
200
+ lock.timed_wait (10 );
201
201
reap_dead_tasks (id);
202
202
DLOG (this , task,
203
203
" scheduler %d resuming ..." , id);
Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ void lock_and_signal::wait() {
68
68
timed_wait (0 );
69
69
}
70
70
71
- bool lock_and_signal::timed_wait (size_t timeout_in_ns ) {
71
+ bool lock_and_signal::timed_wait (size_t timeout_in_ms ) {
72
72
_locked = false ;
73
73
bool rv = true ;
74
74
#if defined(__WIN32__)
75
75
LeaveCriticalSection (&_cs);
76
- DWORD timeout = timeout_in_ns == 0 ? INFINITE : timeout_in_ns / 1000000 ;
76
+ DWORD timeout = timeout_in_ms == 0 ? INFINITE : timeout_in_ms ;
77
77
rv = WaitForSingleObject (_event, timeout) != WAIT_TIMEOUT;
78
78
EnterCriticalSection (&_cs);
79
79
_holding_thread = GetCurrentThreadId ();
@@ -85,7 +85,7 @@ bool lock_and_signal::timed_wait(size_t timeout_in_ns) {
85
85
gettimeofday (&time_val, NULL );
86
86
timespec time_spec;
87
87
time_spec.tv_sec = time_val.tv_sec + 0 ;
88
- time_spec.tv_nsec = time_val.tv_usec * 1000 + timeout_in_ns ;
88
+ time_spec.tv_nsec = time_val.tv_usec * 1000 + timeout_in_ms * 1000000 ;
89
89
if (time_spec.tv_nsec >= 1000000000 ) {
90
90
time_spec.tv_sec ++;
91
91
time_spec.tv_nsec -= 1000000000 ;
You can’t perform that action at this time.
0 commit comments