StgTSO *tso;
rtsBool flag = rtsFalse;
- while (sleeping_queue != END_TSO_QUEUE &&
- (int)(ticks - sleeping_queue->block_info.target) >= 0) {
+ while (sleeping_queue != END_TSO_QUEUE) {
tso = sleeping_queue;
+ if (tso->what_next == ThreadRelocated) {
+ sleeping_queue = tso->_link;
+ continue;
+ }
+ if (((long)ticks - (long)tso->block_info.target) < 0) {
+ break;
+ }
sleeping_queue = tso->_link;
tso->why_blocked = NotBlocked;
tso->_link = END_TSO_QUEUE;
if (select_succeeded || unblock_all) {
for(tso = blocked_queue_hd; tso != END_TSO_QUEUE; tso = next) {
next = tso->_link;
+
+ if (tso->what_next == ThreadRelocated) {
+ continue;
+ }
+
switch (tso->why_blocked) {
case BlockedOnRead:
ready = unblock_all || FD_ISSET(tso->block_info.fd, &rfd);