Fixed|libcore|Lockable: Issue with the mutex lock counter
When unlocking a Lockable, it was first unlocked and only then its lock count was decremented. This meant that execution may have continued elsewhere with an incorrect lock count. Now the lock count is manipulated only while the Lockable still remains locked.
However, keeping track of the lock count is only relevant in debug builds, so the counting is now ifdef'ed away in release builds. This means individual (un)lockings are faster as one doesn't have to lock and unlock the lock count mutex.
Fixed|libcore|Lockable: Issue with the mutex lock counter
When unlocking a Lockable, it was first unlocked and only then its
lock count was decremented. This meant that execution may have
continued elsewhere with an incorrect lock count. Now the lock count
is manipulated only while the Lockable still remains locked.
However, keeping track of the lock count is only relevant in debug
builds, so the counting is now ifdef'ed away in release builds. This
means individual (un)lockings are faster as one doesn't have to lock
and unlock the lock count mutex.