
13 Jan
2013
13 Jan
'13
7:44 p.m.
On Sun, Jan 13, 2013 at 11:15 PM, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr> wrote:
I believed it also but the mutex shouldn't be locked while doing notifications, only when you change the condition and when you wait for the condition to be notified.
Looking at the code now it seems there is a potential race condition. The commit or rollback can set the flag and issue the broadcast just before the enter method acquires the lock and blocks in the cv. I suppose there should be a second check for the flag value under the lock in the enter_once_region method. The locks in commit and rollback functions can be removed altogether then.