CVS: winex/scheduler synchro.c,1.22,1.23
[email protected] 31 Jul 2007 19:39:27 -0000
| Newsgroups | gmane.comp.emulators.winex.cvs |
|---|---|
| Message-ID | <[email protected]> |
Subject: winex/scheduler synchro.c,1.22,1.23Update of /var/lib/cvsd/cvsroot/winex/scheduler
In directory agravaine:/tmp/cvs-serv30885/scheduler
Modified Files:
synchro.c
Log Message:
- implement SignalObjectAndWait
Index: synchro.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/scheduler/synchro.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- synchro.c 31 Jul 2007 17:59:31 -0000 1.22
+++ synchro.c 31 Jul 2007 19:39:25 -0000 1.23
@@ -445,21 +445,15 @@
/***********************************************************************
- * WaitForMultipleObjectsEx (KERNEL32.@)
+ * do_multiple_wait
*/
-DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
- BOOL wait_all, DWORD timeout,
- BOOL alertable )
+static DWORD do_multiple_wait (DWORD count, const HANDLE *handles,
+ BOOL wait_all, DWORD timeout,
+ BOOL alertable, HANDLE hSignalObject)
{
int ret, cookie;
struct timeval tv;
- if (count > MAXIMUM_WAIT_OBJECTS)
- {
- SetLastError( ERROR_INVALID_PARAMETER );
- return WAIT_FAILED;
- }
-
if (timeout == INFINITE) tv.tv_sec = tv.tv_usec = 0;
else get_timeout( &tv, timeout );
@@ -476,6 +470,7 @@
req->cookie = &cookie;
req->sec = tv.tv_sec;
req->usec = tv.tv_usec;
+ req->hSignalObject = hSignalObject;
req->pollfd = &shm_pfd;
wine_server_add_data( req, handles, count * sizeof(HANDLE) );
@@ -510,6 +505,7 @@
req->cookie = &cookie;
req->sec = tv.tv_sec;
req->usec = tv.tv_usec;
+ req->hSignalObject = hSignalObject;
wine_server_add_data( req, handles, count * sizeof(HANDLE) );
if (wait_all) req->flags |= SELECT_ALL;
@@ -537,6 +533,36 @@
/***********************************************************************
+ * WaitForMultipleObjectsEx (KERNEL32.@)
+ */
+DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
+ BOOL wait_all, DWORD timeout,
+ BOOL alertable )
+{
+ if (count > MAXIMUM_WAIT_OBJECTS)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return WAIT_FAILED;
+ }
+
+ return do_multiple_wait (count, handles, wait_all, timeout, alertable, 0);
+}
+
+
+/***********************************************************************
+ * SignalObjectAndWait (KERNEL32.@)
+ */
+DWORD WINAPI SignalObjectAndWait (HANDLE hObjectToSignal,
+ HANDLE hObjectToWaitOn,
+ DWORD dwMilliseconds,
+ BOOL bAlertable)
+{
+ return do_multiple_wait (1, &hObjectToWaitOn, FALSE, dwMilliseconds,
+ bAlertable, hObjectToSignal);
+}
+
+
+/***********************************************************************
* WaitForSingleObject (KERNEL.460)
*/
DWORD WINAPI WaitForSingleObject16( HANDLE handle, DWORD timeout )