From d73d6da23e77d5b7a803209319ad2709f03505a9 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 4 Feb 2013 14:18:53 +0100 Subject: Fix flush of fd-driver on Windows --- erts/emulator/sys/win32/sys.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'erts/emulator/sys/win32/sys.c') diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c index 307ca4866f..133cfd3549 100755 --- a/erts/emulator/sys/win32/sys.c +++ b/erts/emulator/sys/win32/sys.c @@ -916,6 +916,8 @@ init_async_io(DriverData *dp, AsyncIo* aio, int use_threads) if (aio->ov.hEvent == NULL) return -1; if (use_threads) { + OV_BUFFER_PTR(aio) = NULL; + OV_NUM_TO_READ(aio) = 0; aio->ioAllowed = CreateAutoEvent(FALSE); if (aio->ioAllowed == NULL) return -1; @@ -2330,6 +2332,7 @@ static void fd_stop(ErlDrvData data) (void) driver_select(dp->port_num, (ErlDrvEvent)dp->out.ov.hEvent, ERL_DRV_WRITE, 0); + ASSERT(dp->out.flushEvent); SetEvent(dp->out.flushEvent); WaitForSingleObject(dp->out.flushReplyEvent, INFINITE); } -- cgit v1.2.3