[Mono-devel-list] Fix for deadlocks on thread abort/suspend/exit

Lluis Sanchez lluis at ximian.com
Tue May 10 14:00:53 EDT 2005


Hi!

The following patch fixes some deadlocks that may happen when threads
are suspended or when the application exits. The patch does basically
the following:
      * All locks to the thread lock have been moved to unmanaged code.
        This is needed because if a thread is suspended while holding
        that lock it may result in a deadlock.
      * The Start_internal icall has been removed, and Thread_internal
        does now all work of creating and starting the thread. In this
        way the thread locking can be done in the icall.
      * There is a new event that is signaled when a thread changes its
        background mode. When the main thread has finished its work and
        it is waiting for the secondary threads to end, it will detect
        the state change and will remove threads that switched to
        background mode from the wait list. I added a new
        wait_for_tids_or_state_change method that implements this wait
        (the difference from wait_for_tids is that it adds the new event
        in the wait list, and that it can't use the waitAll flag).

Is it OK to commit?
Lluis.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: metadata.diff
Type: text/x-patch
Size: 18792 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050510/5ea949d2/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: corlib.diff
Type: text/x-patch
Size: 5918 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050510/5ea949d2/attachment-0001.bin 


More information about the Mono-devel-list mailing list