# HG changeset patch # User atmosfear # Date 989241835 0 # Node ID 3156ab0adffe43a13187c08dea97e2778a5ef92f # Parent f44cf2772aa1a29e27e8e06701ce3b0127c4a786 Applies kabis changes to avifile 0.6 cvs diff -r f44cf2772aa1 -r 3156ab0adffe loader/win32.c --- 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);