wrowe 02/03/12 18:28:09
Modified: misc/win32 misc.c
Log:
Some extra diagnostics I'm using, thought others might enjoy.
This patch helps us dump WaitForsomanyObjects calls.
Revision Changes Path
1.12 +16 -2 apr/misc/win32/misc.c
Index: misc.c
===================================================================
RCS file: /home/cvs/apr/misc/win32/misc.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- misc.c 18 Feb 2002 06:01:27 -0000 1.11
+++ misc.c 13 Mar 2002 02:28:09 -0000 1.12
@@ -236,7 +236,7 @@
if (!nh) {
(sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n",
- ha, seq, GetCurrentThreadId(), fn, fl, ln);
+ (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln);
(EnterCriticalSection)(&cs);
(WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL);
(LeaveCriticalSection)(&cs);
@@ -248,8 +248,22 @@
do {
HANDLE *hv = va_arg(a, HANDLE*);
char *dsc = va_arg(a, char*);
+ if (strcmp(dsc, "Signaled") == 0) {
+ if ((DWORD)ha >= STATUS_WAIT_0
+ && (DWORD)ha < STATUS_ABANDONED_WAIT_0) {
+ hv += (DWORD)ha;
+ }
+ else if ((DWORD)ha >= STATUS_ABANDONED_WAIT_0
+ && (DWORD)ha < STATUS_USER_APC) {
+ hv += (DWORD)ha - STATUS_ABANDONED_WAIT_0;
+ dsc = "Abandoned";
+ }
+ else if ((DWORD)ha == WAIT_TIMEOUT) {
+ dsc = "Timed Out";
+ }
+ }
(sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n",
- *hv, seq, GetCurrentThreadId(),
+ (DWORD*)*hv, seq, GetCurrentThreadId(),
fn, dsc, fl, ln);
(WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL);
} while (--nh);