Methods and systems for analyzing multi-threaded programs are provided.
The predisposed execution of multi-threaded programs is modified to cause
and detect latent deadlocks. When a thread attempts to acquire a
synchronization object, it is determined if the synchronization object
was previously held by a thread that subsequently acquired another
synchronization object while still holding the first. If this occurred,
the thread is suspended and may be awakened by a thread that has acquired
the synchronization object. The newly awakened thread may then attempt to
acquire a synchronization object that is held by the second thread
thereby increasing the likelihood that a latent deadlock will be caused
and detected.