modified mutex in windows make the lock non-reentrant