commit | 1c19b87d7380ffba4734808b301340c1018c6c36 | [log] [tgz] |
---|---|---|
author | Mike Burrows <m3b@google.com> | Mon May 23 15:19:46 2016 -0700 |
committer | Mike Burrows <m3b@google.com> | Mon May 23 15:19:46 2016 -0700 |
tree | 7a32c009e4b99f61fe51791946e350eb6324608c | |
parent | d0654bb54ce310d9f4a21d4cdebca66732daab72 [diff] |
v.io/x/lib/nsync: bug fix when not transfering waiters from CV to Mu In CV's wakeWaiters() call, I set the mutex's muDesigWaker bit if all the threads signalled are woken, and none are transferred. Unfortunately, I did this irrespective of the state of the mutex. It's legal to set the muDesigWaker only if neither the spinlock or mutex or held by a thread other than the current thread. This change tests for that condition. It also does sets muDesigWaker if it can on the first try. It does not wait, since setting this bit is an optimization. This change also adds a new test (cv_timeout_stress_test.go) which unconvered the bug, and an AssertHeld() call on mutex. Change-Id: I4cf01178361e2c39c9d1451bdda268ad05829805
This repository contains general purpose libraries used by the Vanadium project.