1.0.48.10: add deadlock detection to spinlocks and mutexes
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 11 May 2011 16:48:37 +0000 (16:48 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 11 May 2011 16:48:37 +0000 (16:48 +0000)
commit23e31980c78d174ef9cb775bf28f970890327fea
treed381663551465959134708f290f92ecc1b8d7e7d
parenta1a34a500b880ab761291350300d8d3184574183
1.0.48.10: add deadlock detection to spinlocks and mutexes

 Each thread gets a WAITING-FOR slot which holds the lock it is
 currently trying to acquire.

 After initial try at lock acquisition fails, we check for deadlocks:
 we look at the thread that owns the lock we want -> lock it is
 waiting for, etc, recursively, until we either bottom out or find
 someone waiting for us.

 Print thread as having state WAITING if it is waiting for a lock.

 Add a PRINT-OBJECT methods for MUTEXes and SPINLOCKs.

 SB-THREAD:THREAD-DEADLOCK-CYCLE contains a list of the
 threads and locks involved, so that the situation can be
 analyzed even afer a handler has broken the deadlock.
NEWS
package-data-list.lisp-expr
src/code/cold-init.lisp
src/code/deadline.lisp
src/code/target-thread.lisp
src/code/thread.lisp
tests/threads.impure.lisp
tests/threads.pure.lisp
tests/timer.impure.lisp
version.lisp-expr