progs/wgl: Tweak the initialization wait in wglthreads.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 17 Jun 2009 14:22:32 +0000 (15:22 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 17 Jun 2009 14:23:25 +0000 (15:23 +0100)
There was still a non-zero probability for wglShareLists of failing.

progs/wgl/wglthreads/wglthreads.c

index 405b5db..27dca10 100644 (file)
@@ -507,9 +507,9 @@ ThreadProc(void *p)
    struct winthread *wt = (struct winthread *) p;
    HGLRC share;
 
-   /* Wait for first thread context */
+   /* Wait for the previous thread */
    if(Texture && wt->Index > 0) {
-      WaitForSingleObject(WinThreads[0].hEventInitialised, INFINITE);
+      WaitForSingleObject(WinThreads[wt->Index - 1].hEventInitialised, INFINITE);
       share = WinThreads[0].Context;
    }
    else