Add Bool.CAS for compare-and-swap semantics (#23)

This commit is contained in:
Prashant Varanasi
2017-05-09 12:57:10 -07:00
committed by GitHub
parent 1d7f075bbe
commit 3f020e6d5d
3 changed files with 14 additions and 0 deletions

View File

@@ -122,6 +122,8 @@ func TestStressBool(t *testing.T) {
atom.Load()
atom.Store(false)
atom.Swap(true)
atom.CAS(true, false)
atom.CAS(true, false)
atom.Load()
atom.Toggle()
atom.Toggle()