collapse threads should either successfully take the lock or fail immediately
(the thread should never hang while trying to acquire it)
Merge pull request #309 from Incubaid/collapse-no-race

collapse threads should either successfully take the lock or fail immedi...