Skip to content

Commit

Permalink
Make it less fatal to not call ioManagerStart()
Browse files Browse the repository at this point in the history
For clients that forget to do hs_add_root()
  • Loading branch information
simonmar committed May 29, 2008
1 parent 1d47f08 commit eacbef6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rts/win32/ThrIOManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ readIOManagerEvent (void)
#if defined(THREADED_RTS)
HsWord32 res;

ACQUIRE_LOCK(&event_buf_mutex);
if (io_manager_event != INVALID_HANDLE_VALUE) {
ACQUIRE_LOCK(&event_buf_mutex);
if (next_event == 0) {
res = 0; // no event to return
} else {
Expand All @@ -80,10 +80,10 @@ readIOManagerEvent (void)
}
}
}
RELEASE_LOCK(&event_buf_mutex);
} else {
res = 0;
}
RELEASE_LOCK(&event_buf_mutex);
// debugBelch("readIOManagerEvent: %d\n", res);
return res;
#else
Expand All @@ -96,8 +96,8 @@ sendIOManagerEvent (HsWord32 event)
{
#if defined(THREADED_RTS)
// debugBelch("sendIOManagerEvent: %d\n", event);
ACQUIRE_LOCK(&event_buf_mutex);
if (io_manager_event != INVALID_HANDLE_VALUE) {
ACQUIRE_LOCK(&event_buf_mutex);
if (next_event == EVENT_BUFSIZ) {
errorBelch("event buffer overflowed; event dropped");
} else {
Expand All @@ -107,8 +107,8 @@ sendIOManagerEvent (HsWord32 event)
}
event_buf[next_event++] = (StgWord32)event;
}
RELEASE_LOCK(&event_buf_mutex);
}
RELEASE_LOCK(&event_buf_mutex);
#endif
}

Expand Down

0 comments on commit eacbef6

Please sign in to comment.