mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Fix atomic value updating
This commit is contained in:
parent
27aff26bfd
commit
4564531f8b
@ -182,7 +182,7 @@ internal inline fun AtomicLong.updateWhen(condition: (Long) -> Boolean, update:
|
||||
while (true) {
|
||||
val current = value
|
||||
if (condition(current)) {
|
||||
if (compareAndSet(0, update(current))) {
|
||||
if (compareAndSet(current, update(current))) {
|
||||
return true
|
||||
} else continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user