v0.0.271 return old value in AtomicBool::Set
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 53s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 53s
This commit is contained in:
@@ -27,10 +27,12 @@ func (a *AtomicBool) Get() bool {
|
||||
return a.v
|
||||
}
|
||||
|
||||
func (a *AtomicBool) Set(value bool) {
|
||||
func (a *AtomicBool) Set(value bool) bool {
|
||||
a.lock.Lock()
|
||||
defer a.lock.Unlock()
|
||||
|
||||
oldValue := a.v
|
||||
|
||||
a.v = value
|
||||
|
||||
for k, v := range a.listener {
|
||||
@@ -42,6 +44,8 @@ func (a *AtomicBool) Set(value bool) {
|
||||
delete(a.listener, k)
|
||||
}
|
||||
}
|
||||
|
||||
return oldValue
|
||||
}
|
||||
|
||||
func (a *AtomicBool) Wait(waitFor bool) {
|
||||
|
Reference in New Issue
Block a user