Performance improvements by unlocking before signalling CVariables
Performance improvements by unlocking before signalling CVariables

It is not required to be currently holding the mutex in order to
signal the associated condition variable. By unlocking the mutex
prior to signalling or broadcasting on the CVariable, the thread
that wakes due to the CVariable signalling does not have to wait
again for the mutex to be released and can proceed immediately.

Also cleared up some of the loopy code in SetEvent by returning
early rather than continually breaking around.

neosmart/pevents,neosmart/pevents