1
0
Fork 0
master
Philip O'Toole 9 months ago committed by GitHub
parent 34ea927e17
commit 1002d2a29f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,12 +26,12 @@ func NewCheckAndSet() *CheckAndSet {
func (c *CheckAndSet) Begin() error {
if c.state.CompareAndSwap(0, 1) {
return nil
} else {
return ErrCASConflict
}
return ErrCASConflict
}
// End exits the critical section.
func (c *CheckAndSet) End() {
c.state.Store(0)
}

Loading…
Cancel
Save