Patent ID: 8499299

Claim:
A computer-readable non-transitory medium storing computer-executable instructions, the computer-executable instructions comprising: computer-executable instructions configured to create a single application-level mutex and forcing a first thread among a plurality of threads of an executing virtual machine application program to acquire the application-level mutex; computer-executable instructions configured to detect when the first thread is about to make a potentially blocking call; computer-executable instructions configured to force the first thread to release the application-level mutex prior to the first thread making the potentially blocking call allowing another thread of the plurality of threads to acquire the application-level mutex; computer-executable instructions configured to detect when the first thread has completed the potentially blocking call; computer-executable instructions configured to force the first thread to re-acquire the application-level mutex after the first thread completes the potentially blocking call; computer-executable instructions configured to create and store a record in a computer indicating whether threads acquire mutexes other than the application-level mutex during execution of the virtual machine application program (a) while holding the application-level mutex or (b) while not holding the application-level mutex; computer-executable instructions configured to use said record when the first thread attempts to acquire a first mutex, other than the application-level mutex, that is then held by a second thread of the plurality of threads to determine whether the second thread acquired the first mutex (a) while holding the application-level mutex or (b) while not holding the application-level mutex; and computer-executable instructions configured to force the first thread to release the application-level mutex if said record indicates that the second thread acquired the first mutex while holding the application-level mutex; and computer-executable instructions configured to allow the first thread to retain the application-level mutex at least until the second thread releases the first mutex if said record indicates that the second thread acquired the first mutex while not holding the application-level mutex.