arvenil/ninja-mutex — pull request #2 by NoiseByNorthwest (2014-06-16 07:17:49+00:00)
Title: Infinite loop in mutex dtor when backend is unavailable

There is another issue (infinite loop) with the mutex destructor. It occurs when the lock backend service is unavailable at release time. The loop in destructor should take in account the releaseLock()'s return value (ie release status) and stop its processing in case of release failure. I have chosen to throw an exception in this case.
There is also a consistency break between "counter" and "acquired" bit which always means counter == 0 so I have removed this one.
This patch is splitted into 2 commits. The first is the unit test which proves the failure (no throw) when the backend is unavailable and the second is the fix.