Do not return from idle_loop() with lock held
authorMarco Costalba <mcostalba@gmail.com>
Sun, 2 May 2010 11:02:41 +0000 (12:02 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 5 May 2010 11:16:12 +0000 (12:16 +0100)
commitf16c231bc9b239cc270e3103be93899f3204df76
tree6c17dad587f702a714115e81558fcb1b12a543b7
parentb89733b46c9267f61ac41c48204557483658435b
Do not return from idle_loop() with lock held

Master thread returns from idle_loop() when sp->cpus == 0,
but cpus is decremented by slave threads under sp->lock,
so it could happen that we return in split(), where we release
the split point, with sp->lock still held.

This patch guarantees that sp->lock is released when returning
to split().

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp