X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fwin32%2FAsyncIO.c;h=6fb9a2b22d01383958db5806f5020dd5f1194b71;hb=4267e8dea62ca55a6dd623b09e81a9e70536bcca;hp=3f99113b7fd8411851a630e9a5885c13e2923943;hpb=610de7d17e09318272b7516bd9b97e8b2cbd170c;p=ghc-hetmet.git diff --git a/rts/win32/AsyncIO.c b/rts/win32/AsyncIO.c index 3f99113..6fb9a2b 100644 --- a/rts/win32/AsyncIO.c +++ b/rts/win32/AsyncIO.c @@ -4,6 +4,9 @@ * * (c) sof, 2002-2003. */ + +#if !defined(THREADED_RTS) + #include "Rts.h" #include "RtsUtils.h" #include @@ -171,8 +174,9 @@ startupAsyncIO() } void -shutdownAsyncIO() +shutdownAsyncIO(rtsBool wait_threads) { + ShutdownIOManager(wait_threads); if (completed_req_event != INVALID_HANDLE_VALUE) { CloseHandle(completed_req_event); completed_req_event = INVALID_HANDLE_VALUE; @@ -185,7 +189,7 @@ shutdownAsyncIO() CloseHandle(completed_table_sema); completed_table_sema = NULL; } - ShutdownIOManager(); + DeleteCriticalSection(&queue_lock); } /* @@ -271,7 +275,7 @@ 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; prev = tso, tso = tso->_link) { switch(tso->why_blocked) { case BlockedOnRead: @@ -286,16 +290,16 @@ start: /* Drop the matched TSO from blocked_queue */ if (prev) { - prev->link = tso->link; + setTSOLink(&MainCapability, prev, tso->_link); } else { - blocked_queue_hd = tso->link; + blocked_queue_hd = tso->_link; } if (blocked_queue_tl == tso) { blocked_queue_tl = prev ? prev : END_TSO_QUEUE; } /* Terminates the run queue + this inner for-loop. */ - tso->link = END_TSO_QUEUE; + tso->_link = END_TSO_QUEUE; tso->why_blocked = NotBlocked; pushOnRunQueue(&MainCapability, tso); break; @@ -354,3 +358,4 @@ resetAbandonRequestWait( void ) ResetEvent(abandon_req_wait); } +#endif /* !defined(THREADED_RTS) */