physfs.c
changeset 193 830c165052a5
parent 186 fcabc280b29d
child 214 19846c18071b
equal deleted inserted replaced
192:8777e3f08724 193:830c165052a5
   105 static ErrMsg *findErrorForCurrentThread(void)
   105 static ErrMsg *findErrorForCurrentThread(void)
   106 {
   106 {
   107     ErrMsg *i;
   107     ErrMsg *i;
   108     PHYSFS_uint64 tid;
   108     PHYSFS_uint64 tid;
   109 
   109 
   110     __PHYSFS_platformGrabMutex(errorLock);
   110     if (initialized)
       
   111         __PHYSFS_platformGrabMutex(errorLock);
       
   112 
   111     if (errorMessages != NULL)
   113     if (errorMessages != NULL)
   112     {
   114     {
   113         tid = __PHYSFS_platformGetThreadID();
   115         tid = __PHYSFS_platformGetThreadID();
   114 
   116 
   115         for (i = errorMessages; i != NULL; i = i->next)
   117         for (i = errorMessages; i != NULL; i = i->next)
   119                 __PHYSFS_platformReleaseMutex(errorLock);
   121                 __PHYSFS_platformReleaseMutex(errorLock);
   120                 return(i);
   122                 return(i);
   121             } /* if */
   123             } /* if */
   122         } /* for */
   124         } /* for */
   123     } /* if */
   125     } /* if */
   124     __PHYSFS_platformReleaseMutex(errorLock);
   126 
       
   127     if (initialized)
       
   128         __PHYSFS_platformReleaseMutex(errorLock);
   125 
   129 
   126     return(NULL);   /* no error available. */
   130     return(NULL);   /* no error available. */
   127 } /* findErrorForCurrentThread */
   131 } /* findErrorForCurrentThread */
   128 
   132 
   129 
   133