File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -892,7 +892,9 @@ void Runtime::pause(int timeout) {
892892 delete event;
893893 }
894894 slept = dev_get_millisecond_count () - now;
895- if (timeout - slept > WAIT_INTERVAL) {
895+ if (slept > timeout) {
896+ break ;
897+ } else if (timeout - slept > WAIT_INTERVAL) {
896898 usleep (WAIT_INTERVAL * 1000 );
897899 } else {
898900 usleep ((timeout - slept) * 1000 );
Original file line number Diff line number Diff line change @@ -451,7 +451,9 @@ void dev_delay(uint32_t timeout) {
451451 break ;
452452 }
453453 slept = dev_get_millisecond_count () - now;
454- if (timeout - slept > WAIT_INTERVAL) {
454+ if (slept > timeout) {
455+ break ;
456+ } else if (timeout - slept > WAIT_INTERVAL) {
455457 usleep (WAIT_INTERVAL * 1000 );
456458 } else {
457459 usleep ((timeout - slept) * 1000 );
Original file line number Diff line number Diff line change @@ -429,7 +429,9 @@ void Runtime::pause(int timeout) {
429429 delete event;
430430 }
431431 slept = dev_get_millisecond_count () - now;
432- if (timeout - slept > WAIT_INTERVAL) {
432+ if (slept > timeout) {
433+ break ;
434+ } else if (timeout - slept > WAIT_INTERVAL) {
433435 usleep (WAIT_INTERVAL * 1000 );
434436 } else {
435437 usleep ((timeout - slept) * 1000 );
You can’t perform that action at this time.
0 commit comments