#include <windows.h>
#include <stdio.h>
#include "Schedule.h"
-#include "RtsFlags.h"
#include "Capability.h"
#include "win32/AsyncIO.h"
#include "win32/IOManager.h"
unsigned int rID = completedTable[i].reqID;
prev = NULL;
- for(tso = blocked_queue_hd ; tso != END_TSO_QUEUE; prev = tso, tso = tso->_link) {
+ for(tso = blocked_queue_hd ; tso != END_TSO_QUEUE; tso = tso->_link) {
- switch(tso->why_blocked) {
+ switch(tso->why_blocked) {
case BlockedOnRead:
case BlockedOnWrite:
case BlockedOnDoProc:
/* Terminates the run queue + this inner for-loop. */
tso->_link = END_TSO_QUEUE;
tso->why_blocked = NotBlocked;
+ // save the StgAsyncIOResult in the
+ // stg_block_async_info stack frame, because
+ // the block_info field will be overwritten by
+ // pushOnRunQueue().
+ tso->stackobj->sp[1] = (W_)tso->block_info.async_result;
pushOnRunQueue(&MainCapability, tso);
break;
}
}
break;
}
+
+ prev = tso;
}
/* Signal that there's completed table slots available */
if ( !ReleaseSemaphore(completed_table_sema, 1, NULL) ) {