X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Frts%2Fwin32%2FAsyncIO.c;h=7efaf14e8930c4635f6dab69a0316174157b8ef6;hp=b823308b5672c4eb1b23ffddad1a929263efb5a8;hb=18340925716fb6e68672c69bd263ad9041f81822;hpb=5affd8114e7ba87fa289eb72760a597456aea4cb diff --git a/ghc/rts/win32/AsyncIO.c b/ghc/rts/win32/AsyncIO.c index b823308..7efaf14 100644 --- a/ghc/rts/win32/AsyncIO.c +++ b/ghc/rts/win32/AsyncIO.c @@ -51,10 +51,9 @@ static int issued_reqs; static void onIOComplete(unsigned int reqID, - void* param STG_UNUSED, int fd STG_UNUSED, int len, - char* buf STG_UNUSED, + void* buf STG_UNUSED, int errCode) { /* Deposit result of request in queue/table */ @@ -96,21 +95,34 @@ addIORequest(int fd, #if 0 fprintf(stderr, "addIOReq: %d %d %d\n", fd, forWriting, len); fflush(stderr); #endif - return AddIORequest(fd,forWriting,isSock,len,buf,0,onIOComplete); + return AddIORequest(fd,forWriting,isSock,len,buf,onIOComplete); } unsigned int -addDelayRequest(int msecs) +addDelayRequest(int msecs) { EnterCriticalSection(&queue_lock); issued_reqs++; LeaveCriticalSection(&queue_lock); #if 0 - fprintf(stderr, "addDelayReq: %d %d %d\n", msecs); fflush(stderr); + fprintf(stderr, "addDelayReq: %d\n", msecs); fflush(stderr); #endif - return AddDelayRequest(msecs,0,onIOComplete); + return AddDelayRequest(msecs,onIOComplete); } +unsigned int +addDoProcRequest(void* proc, void* param) +{ + EnterCriticalSection(&queue_lock); + issued_reqs++; + LeaveCriticalSection(&queue_lock); +#if 0 + fprintf(stderr, "addProcReq: %p %p\n", proc, param); fflush(stderr); +#endif + return AddProcRequest(proc,param,onIOComplete); +} + + int startupAsyncIO() { @@ -186,6 +198,7 @@ start: case BlockedOnDelay: case BlockedOnRead: case BlockedOnWrite: + case BlockedOnDoProc: if (tso->block_info.async_result->reqID == rID) { /* Found the thread blocked waiting on request; stodgily fill * in its result block.