fix bug related to sleeping and Windows networking

svn: r14053
This commit is contained in:
Matthew Flatt 2009-03-11 17:14:39 +00:00
parent 63af81bd85
commit d647999705
2 changed files with 11 additions and 3 deletions

View File

@ -303,6 +303,7 @@ void MrEdDispatchEvent(MSG *msg)
LeaveEvent *e; LeaveEvent *e;
e = (LeaveEvent *)GET_SAFEREF(sr); e = (LeaveEvent *)GET_SAFEREF(sr);
FREE_SAFEREF(sr); FREE_SAFEREF(sr);
if (e)
wxDoLeaveEvent(e->wnd, e->x, e->y, e->flags); wxDoLeaveEvent(e->wnd, e->x, e->y, e->flags);
} else if (!wxTheApp->ProcessMessage(msg)) { } else if (!wxTheApp->ProcessMessage(msg)) {
#if wxLOG_EVENTS #if wxLOG_EVENTS
@ -983,7 +984,10 @@ void MrEdMSWSleep(float secs, void *fds)
} }
if (th2) { if (th2) {
closesocket(fake); while (closesocket(fake)) {
if (WSAGetLastError() != WSAEINPROGRESS)
break;
}
WaitForSingleObject(th2, INFINITE); WaitForSingleObject(th2, INFINITE);
scheme_forget_thread(thread_memory); scheme_forget_thread(thread_memory);
CloseHandle(th2); CloseHandle(th2);

View File

@ -8102,7 +8102,11 @@ static void default_sleep(float v, void *fds)
} }
clean_up_wait(result, array, rps, count); clean_up_wait(result, array, rps, count);
closesocket(fake); /* cause selector thread to end */ /* cause selector thread to end: */
while (closesocket(fake)) {
if (WSAGetLastError() != WSAEINPROGRESS)
break;
}
WaitForSingleObject(th, INFINITE); WaitForSingleObject(th, INFINITE);
scheme_forget_thread(thread_memory); scheme_forget_thread(thread_memory);