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 405b5db884239942fff7a8e4d167636094cce11f..27dca10f2a06ba07d648a54ad45be398810d20c9 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