mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-04 06:10:07 +08:00
[core] Fix bad atomic
This commit is contained in:
parent
1c79da0f38
commit
dd143890cd
@ -53,7 +53,7 @@ internal class OnlineMessageSourceFromFriendImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
override val ids: IntArray get() = sequenceIds // msg.msgBody.richText.attr!!.random
|
||||
override val internalIds: IntArray = msg.mapToIntArray {
|
||||
@ -91,7 +91,7 @@ internal class OnlineMessageSourceFromStrangerImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
override val ids: IntArray get() = sequenceIds // msg.msgBody.richText.attr!!.random
|
||||
@ -170,7 +170,7 @@ internal class OnlineMessageSourceFromTempImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
override val ids: IntArray get() = sequenceIds //
|
||||
@ -211,7 +211,7 @@ internal class OnlineMessageSourceFromGroupImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
override val sequenceIds: IntArray = msg.mapToIntArray { it.msgHead.msgSeq }
|
||||
override val internalIds: IntArray = msg.mapToIntArray { it.msgBody.richText.attr!!.random }
|
||||
|
@ -62,7 +62,7 @@ internal class OfflineMessageSourceImplData(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
override fun toJceData(): ImMsgBody.SourceMsg {
|
||||
|
@ -102,7 +102,7 @@ internal class OnlineMessageSourceToFriendImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
private val jceData: ImMsgBody.SourceMsg by lazy { toJceDataImpl(subject) }
|
||||
@ -141,7 +141,7 @@ internal class OnlineMessageSourceToStrangerImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
private val jceData: ImMsgBody.SourceMsg by lazy { toJceDataImpl(subject) }
|
||||
@ -180,7 +180,7 @@ internal class OnlineMessageSourceToTempImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
private val jceData: ImMsgBody.SourceMsg by lazy { toJceDataImpl(subject) }
|
||||
@ -215,7 +215,7 @@ internal class OnlineMessageSourceToGroupImpl(
|
||||
private val _isRecalledOrPlanned = atomic(false)
|
||||
|
||||
@Transient
|
||||
override val isRecalledOrPlanned: Boolean = _isRecalledOrPlanned.value
|
||||
override val isRecalledOrPlanned: Boolean get() = _isRecalledOrPlanned.value
|
||||
override fun setRecalled(): Boolean = _isRecalledOrPlanned.compareAndSet(expect = false, update = true)
|
||||
|
||||
|
||||
|
@ -122,7 +122,7 @@ internal class SsoProcessorImpl(
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private val _firstLoginResult: AtomicRef<FirstLoginResult?> = atomic(null)
|
||||
override val firstLoginResult = _firstLoginResult.value
|
||||
override val firstLoginResult get() = _firstLoginResult.value
|
||||
override fun casFirstLoginResult(expect: FirstLoginResult?, update: FirstLoginResult?): Boolean =
|
||||
_firstLoginResult.compareAndSet(expect, update)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user