Fixed some closing while executing a blocking call bugs.

This commit is contained in:
hedgecrw85 2015-11-20 11:14:45 -06:00
parent 51d7e2fb01
commit 9ae2f07f2a
7 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ JNIEXPORT jint JNICALL Java_com_fazecast_jSerialComm_SerialPort_waitForEvent(JNI
BOOL continueWaiting = TRUE;
while (continueWaiting)
{
readResult = waitForSingleObject(overlappedStruct.hEvent, 750);
readResult = WaitForSingleObject(overlappedStruct.hEvent, 750);
continueWaiting = ((readResult == WAIT_TIMEOUT) && (env->GetIntField(obj, eventFlagsField) != 0));
}
if ((readResult != WAIT_OBJECT_0) || (GetOverlappedResult(serialPortHandle, &overlappedStruct, &numBytesRead, TRUE) == FALSE))