|
|
|
@@ -37,13 +37,13 @@ bool JackWinEvent::Signal() |
|
|
|
assert(fEvent); |
|
|
|
|
|
|
|
if (fFlush) |
|
|
|
return true;
|
|
|
|
return true; |
|
|
|
|
|
|
|
if (!(res = SetEvent(fEvent))) { |
|
|
|
jack_error("JackWinEvent::Signal name = %s err = %ld", fName, GetLastError()); |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
return res;
|
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
bool JackWinEvent::SignalAll() |
|
|
|
@@ -52,22 +52,21 @@ bool JackWinEvent::SignalAll() |
|
|
|
assert(fEvent); |
|
|
|
|
|
|
|
if (fFlush) |
|
|
|
return true;
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
if (!(res = SetEvent(fEvent))) { |
|
|
|
jack_error("JackWinEvent::SignalAll name = %s err = %ld", fName, GetLastError()); |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
return res;
|
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
bool JackWinEvent::Wait() |
|
|
|
{ |
|
|
|
DWORD res; |
|
|
|
|
|
|
|
if ((res = WaitForSingleObject(fEvent, INFINITE)) != WAIT_OBJECT_0) { |
|
|
|
if (res == WAIT_TIMEOUT)
|
|
|
|
jack_error("JackWinEvent::TimedWait name = %s time_out", fName); |
|
|
|
if ((res = WaitForSingleObject(fEvent, INFINITE)) == WAIT_TIMEOUT) { |
|
|
|
jack_error("JackWinEvent::TimedWait name = %s time_out", fName); |
|
|
|
} |
|
|
|
|
|
|
|
return (res == WAIT_OBJECT_0); |
|
|
|
@@ -75,12 +74,11 @@ bool JackWinEvent::Wait() |
|
|
|
|
|
|
|
bool JackWinEvent::TimedWait(long usec) |
|
|
|
{ |
|
|
|
DWORD res;
|
|
|
|
DWORD res; |
|
|
|
|
|
|
|
if ((res = WaitForSingleObject(fEvent, usec / 1000)) != WAIT_OBJECT_0) {
|
|
|
|
if (res == WAIT_TIMEOUT) |
|
|
|
jack_error("JackWinEvent::TimedWait name = %s time_out", fName); |
|
|
|
}
|
|
|
|
if ((res = WaitForSingleObject(fEvent, usec / 1000)) == WAIT_TIMEOUT) { |
|
|
|
jack_error("JackWinEvent::TimedWait name = %s time_out", fName); |
|
|
|
} |
|
|
|
|
|
|
|
return (res == WAIT_OBJECT_0); |
|
|
|
} |
|
|
|
@@ -97,7 +95,7 @@ bool JackWinEvent::ConnectInput(const char* name) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if ((fEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, fName)) == NULL) {
|
|
|
|
if ((fEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, fName)) == NULL) { |
|
|
|
jack_error("Connect: can't check in named event name = %s err = %ld", fName, GetLastError()); |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
@@ -118,7 +116,7 @@ bool JackWinEvent::ConnectOutput(const char* name) |
|
|
|
bool JackWinEvent::Disconnect() |
|
|
|
{ |
|
|
|
if (fEvent) { |
|
|
|
JackLog("JackWinEvent::Disconnect %s\n", fName);
|
|
|
|
JackLog("JackWinEvent::Disconnect %s\n", fName); |
|
|
|
CloseHandle(fEvent); |
|
|
|
fEvent = NULL; |
|
|
|
return true; |
|
|
|
|