dinput: Make find_joydevs re-entrant.

This commit is contained in:
Vitaliy Margolen 2008-12-27 11:23:08 -07:00 committed by Alexandre Julliard
parent 2e0aefc1fd
commit ae26ca6c28
1 changed files with 4 additions and 6 deletions

View File

@ -217,11 +217,9 @@ static void find_joydevs(void)
{ {
int i; int i;
if (have_joydevs!=-1) { if (InterlockedCompareExchange(&have_joydevs, 0, -1) != -1)
/* Someone beat us to it */
return; return;
}
have_joydevs = 0;
for (i=0;i<MAX_JOYDEV;i++) { for (i=0;i<MAX_JOYDEV;i++) {
char buf[MAX_PATH]; char buf[MAX_PATH];