724 void __PHYSFS_platformDestroyMutex(void *mutex); |
724 void __PHYSFS_platformDestroyMutex(void *mutex); |
725 |
725 |
726 /* |
726 /* |
727 * Grab possession of a platform-specific mutex. Mutexes should be recursive; |
727 * Grab possession of a platform-specific mutex. Mutexes should be recursive; |
728 * that is, the same thread should be able to call this function multiple |
728 * that is, the same thread should be able to call this function multiple |
729 * times in a row without causing a deadlock. This function should block |
729 * times in a row without causing a deadlock. This function should block |
730 * until a thread can gain possession of the mutex. |
730 * until a thread can gain possession of the mutex. |
731 * |
731 * |
732 * Return non-zero if the mutex was grabbed, zero if there was an |
732 * Return non-zero if the mutex was grabbed, zero if there was an |
733 * unrecoverable problem grabbing it (this should not be a matter of |
733 * unrecoverable problem grabbing it (this should not be a matter of |
734 * timing out! We're talking major system errors; block until the mutex |
734 * timing out! We're talking major system errors; block until the mutex |
735 * is available otherwise.) |
735 * is available otherwise.) |
736 * |
736 * |
737 * _DO NOT_ call __PHYSFS_setError() in here! Since setError calls this |
737 * _DO NOT_ call __PHYSFS_setError() in here! Since setError calls this |
738 * function, you'll cause an infinite recursion. This means you can't |
738 * function, you'll cause an infinite recursion. This means you can't |
739 * use the BAIL_*MACRO* macros, either. |
739 * use the BAIL_*MACRO* macros, either. |
740 */ |
740 */ |
741 int __PHYSFS_platformGrabMutex(void *mutex); |
741 int __PHYSFS_platformGrabMutex(void *mutex); |
742 |
742 |
743 /* |
743 /* |
744 * Relinquish possession of the mutex when this method has been called |
744 * Relinquish possession of the mutex when this method has been called |
745 * once for each time that platformGrabMutex was called. Once possession has |
745 * once for each time that platformGrabMutex was called. Once possession has |
746 * been released, the next thread in line to grab the mutex (if any) may |
746 * been released, the next thread in line to grab the mutex (if any) may |
747 * proceed. |
747 * proceed. |
748 * |
748 * |
749 * _DO NOT_ call __PHYSFS_setError() in here! Since setError calls this |
749 * _DO NOT_ call __PHYSFS_setError() in here! Since setError calls this |