changeset 718:3156ab0adffe

Applies kabis changes to avifile 0.6 cvs
author atmosfear
date Mon, 07 May 2001 13:23:55 +0000
parents f44cf2772aa1
children 26786fde68a9
files loader/win32.c
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/loader/win32.c	Mon May 07 07:52:50 2001 +0000
+++ b/loader/win32.c	Mon May 07 13:23:55 2001 +0000
@@ -584,15 +584,19 @@
 void* WINAPI expWaitForSingleObject(void* object, int duration)
 {
     mutex_list *ml = (mutex_list *)object;
-    int ret=0x12345678; // fixed by Zdenek Kabelac
+    int ret=WAIT_FAILED; // fixed by Zdenek Kabelac
     mutex_list* pp=mlist;
 //    dbgprintf("WaitForSingleObject(0x%x, duration %d) =>\n",object, duration);
-    do {
-	if (pp == NULL) dbgprintf("WaitForSingleObject: NotFound\n");
-	if((pp->pm, mlist->pm)==0)
-		break;;
-     }while((pp=pp->prev));
-    
+    // loop below was slightly fixed - its used just for checking if
+    // this object really exists in our list
+    if (!ml)
+        return (void*) ret;
+    while (pp && (pp->pm != ml->pm))
+        pp = pp->prev;
+    if (!pp) {
+        //dbgprintf("WaitForSingleObject: NotFound\n");
+        return (void*)ret;
+    }
 
     pthread_mutex_lock(ml->pm);