Commit 6e4fa817 authored by Simon Jakobi's avatar Simon Jakobi Committed by Ben Gamari

rts/win32: Assert that the IO manager has been initialised

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4450
parent 5c28ee88
......@@ -435,13 +435,12 @@ AddIORequest ( int fd,
char* buffer,
CompletionProc onCompletion)
{
ASSERT(ioMan);
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) {
free(wItem);
return 0;
}
reqID = ioMan->requestID++;
if (!wItem) return 0;
unsigned int reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = ( isSocket ? WORKER_FOR_SOCKET : 0 ) |
......@@ -467,13 +466,12 @@ BOOL
AddDelayRequest ( HsInt usecs,
CompletionProc onCompletion)
{
ASSERT(ioMan);
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) {
free(wItem);
return false;
}
reqID = ioMan->requestID++;
if (!wItem) return false;
unsigned int reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = WORKER_DELAY;
......@@ -495,13 +493,12 @@ AddProcRequest ( void* proc,
void* param,
CompletionProc onCompletion)
{
ASSERT(ioMan);
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) {
free(wItem);
return false;
}
reqID = ioMan->requestID++;
if (!wItem) return false;
unsigned int reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = WORKER_DO_PROC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment