You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2010/01/13 16:09:13 UTC
svn commit: r898793 - in /commons/sandbox/runtime/trunk/src/main/native:
include/arch/windows/acr_arch_private.h os/win32/dhtml.c os/win32/exec.c
os/win32/fsysio.c os/win32/fsysrw.c os/win32/mutex.c os/win32/sema.c
Author: mturk
Date: Wed Jan 13 15:09:12 2010
New Revision: 898793
URL: http://svn.apache.org/viewvc?rev=898793&view=rev
Log:
Axe WAIT_ABANDONED_n. They always mean WAIT_OBJECT_n (well at least for mutexes)
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/exec.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysrw.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/mutex.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/sema.c
Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h Wed Jan 13 15:09:12 2010
@@ -211,10 +211,7 @@
#define ACR_SIG_WAITER_DONE() InterlockedDecrement(¤t_signal_listeners)
#define ACR_SIGNAL_NWAITERS() InterlockedCompareExchange(¤t_signal_listeners, 0, 0)
-#define WAIT_ABANDONED_1 (WAIT_ABANDONED_0 + 1)
-#define WAIT_ABANDONED_2 (WAIT_ABANDONED_0 + 2)
-#define WAIT_ABANDONED_3 (WAIT_ABANDONED_0 + 3)
-#define WAIT_ABANDONED_4 (WAIT_ABANDONED_0 + 4)
+#define WAIT_ACRSIGNAL_0 WAIT_OBJECT_0
#define WAIT_OBJECT_1 (WAIT_OBJECT_0 + 1)
#define WAIT_OBJECT_2 (WAIT_OBJECT_0 + 2)
#define WAIT_OBJECT_3 (WAIT_OBJECT_0 + 3)
@@ -230,7 +227,14 @@
ACR_SIG_WAITER_INIT();
rc = WaitForMultipleObjectsEx(2, wh, FALSE, dwTimeout, TRUE);
ACR_SIG_WAITER_DONE();
- return rc;
+ if (rc < (WAIT_OBJECT_0 + 2))
+ return rc;
+ else if (rc == WAIT_IO_COMPLETION)
+ return WAIT_OBJECT_0;
+ else if (rc >= WAIT_ABANDONED_0 && rc < (WAIT_ABANDONED_0 + 2))
+ return WAIT_OBJECT_0 + rc - WAIT_ABANDONED_0;
+ else
+ return rc;
}
static ACR_INLINE DWORD ACR_WaitForMultipleObjectOrSignal(DWORD nCount,
@@ -248,9 +252,16 @@
wh[wn + 1] = handles[wn];
}
ACR_SIG_WAITER_INIT();
- rc = WaitForMultipleObjectsEx(wn + 1, wh, FALSE, dwTimeout, TRUE);
+ rc = WaitForMultipleObjectsEx(nCount + 1, wh, FALSE, dwTimeout, TRUE);
ACR_SIG_WAITER_DONE();
- return rc;
+ if (rc < (WAIT_OBJECT_0 + MAXIMUM_WAIT_OBJECTS))
+ return rc;
+ else if (rc == WAIT_IO_COMPLETION)
+ return WAIT_OBJECT_0;
+ else if (rc >= WAIT_ABANDONED_0 && rc < (WAIT_ABANDONED_0 + nCount))
+ return WAIT_OBJECT_0 + rc - WAIT_ABANDONED_0;
+ else
+ return rc;
}
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c Wed Jan 13 15:09:12 2010
@@ -209,10 +209,7 @@
rc = 0;
ws = ACR_WaitForObjectOrSignal(hThread, dwTimeout);
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's satus.
*/
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/exec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/exec.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/exec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/exec.c Wed Jan 13 15:09:12 2010
@@ -370,16 +370,14 @@
do {
DWORD dwTimeout = ep->limit.timeout > 0 ? PROC_TIMEOUT_STEP : INFINITE;
DWORD ws;
-
+ /* Wait for some event.
+ * Note that overlapped Read and Write will be fired immediately
+ * because their events are set on signaled. This usualy means that
+ * the first ReadFile/WriteFile will fail with ERROR_IO_PENDING.
+ */
ws = ACR_WaitForMultipleObjectOrSignal(waitn, waith, dwTimeout);
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_ABANDONED_2:
- case WAIT_ABANDONED_3:
- case WAIT_ABANDONED_4:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's status.
*/
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysio.c Wed Jan 13 15:09:12 2010
@@ -458,10 +458,7 @@
DWORD ws = ACR_WaitForObjectOrSignal(f->overlap.hEvent, INFINITE);
rc = 0;
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's status.
*/
@@ -558,10 +555,7 @@
DWORD ws = ACR_WaitForObjectOrSignal(f->overlap.hEvent, INFINITE);
rc = 0;
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's status.
*/
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysrw.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysrw.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysrw.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/fsysrw.c Wed Jan 13 15:09:12 2010
@@ -38,10 +38,7 @@
do {
switch (ACR_WaitForObjectOrSignal(f->overlap.hEvent,
f->timeout)) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's status.
*/
@@ -90,10 +87,7 @@
do {
switch (ACR_WaitForObjectOrSignal(f->overlap.hEvent, INFINITE)) {
- case WAIT_IO_COMPLETION:
- case WAIT_ABANDONED_0:
- case WAIT_ABANDONED_1:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's status.
*/
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/mutex.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/mutex.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/mutex.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/mutex.c Wed Jan 13 15:09:12 2010
@@ -132,14 +132,12 @@
rc = 0;
ws = ACR_WaitForObjectOrSignal(m, INFINITE);
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's satus.
*/
rc = ACR_DeliverSignals();
break;
- case WAIT_ABANDONED_1:
case WAIT_OBJECT_1:
/* We got the lock */
return 0;
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/sema.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/sema.c?rev=898793&r1=898792&r2=898793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/sema.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/sema.c Wed Jan 13 15:09:12 2010
@@ -169,14 +169,12 @@
rc = 0;
ws = ACR_WaitForObjectOrSignal(s, INFINITE);
switch (ws) {
- case WAIT_IO_COMPLETION:
- case WAIT_OBJECT_0:
+ case WAIT_ACRSIGNAL_0:
/* Signal event is set.
* Get it's satus.
*/
rc = ACR_DeliverSignals();
break;
- case WAIT_ABANDONED_1:
case WAIT_OBJECT_1:
/* We got the lock */
return 0;