projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update submodule pointers
[ghc-hetmet.git]
/
rts
/
win32
/
AsyncIO.c
diff --git
a/rts/win32/AsyncIO.c
b/rts/win32/AsyncIO.c
index
3f99113
..
979df0c
100644
(file)
--- a/
rts/win32/AsyncIO.c
+++ b/
rts/win32/AsyncIO.c
@@
-4,12
+4,14
@@
*
* (c) sof, 2002-2003.
*/
*
* (c) sof, 2002-2003.
*/
+
+#if !defined(THREADED_RTS)
+
#include "Rts.h"
#include "RtsUtils.h"
#include <windows.h>
#include <stdio.h>
#include "Schedule.h"
#include "Rts.h"
#include "RtsUtils.h"
#include <windows.h>
#include <stdio.h>
#include "Schedule.h"
-#include "RtsFlags.h"
#include "Capability.h"
#include "win32/AsyncIO.h"
#include "win32/IOManager.h"
#include "Capability.h"
#include "win32/AsyncIO.h"
#include "win32/IOManager.h"
@@
-171,8
+173,9
@@
startupAsyncIO()
}
void
}
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;
if (completed_req_event != INVALID_HANDLE_VALUE) {
CloseHandle(completed_req_event);
completed_req_event = INVALID_HANDLE_VALUE;
@@
-185,7
+188,7
@@
shutdownAsyncIO()
CloseHandle(completed_table_sema);
completed_table_sema = NULL;
}
CloseHandle(completed_table_sema);
completed_table_sema = NULL;
}
- ShutdownIOManager();
+ DeleteCriticalSection(&queue_lock);
}
/*
}
/*
@@
-271,9
+274,9
@@
start:
unsigned int rID = completedTable[i].reqID;
prev = NULL;
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:
case BlockedOnRead:
case BlockedOnWrite:
case BlockedOnDoProc:
@@
-286,17
+289,22
@@
start:
/* Drop the matched TSO from blocked_queue */
if (prev) {
/* Drop the matched TSO from blocked_queue */
if (prev) {
- prev->link = tso->link;
+ setTSOLink(&MainCapability, prev, tso->_link);
} else {
} 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. */
}
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;
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;
}
pushOnRunQueue(&MainCapability, tso);
break;
}
@@
-307,6
+315,8
@@
start:
}
break;
}
}
break;
}
+
+ prev = tso;
}
/* Signal that there's completed table slots available */
if ( !ReleaseSemaphore(completed_table_sema, 1, NULL) ) {
}
/* Signal that there's completed table slots available */
if ( !ReleaseSemaphore(completed_table_sema, 1, NULL) ) {
@@
-354,3
+364,4
@@
resetAbandonRequestWait( void )
ResetEvent(abandon_req_wait);
}
ResetEvent(abandon_req_wait);
}
+#endif /* !defined(THREADED_RTS) */