X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fwin32%2FAsyncIO.c;h=ff2e1a24980167e3b79a3fd6107d3a28d8ced81b;hb=f30d527344db528618f64a25250a3be557d9f287;hp=6fb9a2b22d01383958db5806f5020dd5f1194b71;hpb=052ad75a87e7f84d9dcf3115c3ec87bd119cc90d;p=ghc-hetmet.git diff --git a/rts/win32/AsyncIO.c b/rts/win32/AsyncIO.c index 6fb9a2b..ff2e1a2 100644 --- a/rts/win32/AsyncIO.c +++ b/rts/win32/AsyncIO.c @@ -12,7 +12,6 @@ #include #include #include "Schedule.h" -#include "RtsFlags.h" #include "Capability.h" #include "win32/AsyncIO.h" #include "win32/IOManager.h" @@ -275,9 +274,9 @@ start: 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: @@ -301,6 +300,11 @@ start: /* 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->sp[1] = (W_)tso->block_info.async_result; pushOnRunQueue(&MainCapability, tso); break; } @@ -311,6 +315,8 @@ start: } break; } + + prev = tso; } /* Signal that there's completed table slots available */ if ( !ReleaseSemaphore(completed_table_sema, 1, NULL) ) {