[core] Fix bad atomic

This commit is contained in:
Karlatemp 2022-11-08 12:41:02 +08:00
parent 1c79da0f38
commit dd143890cd
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59
4 changed files with 10 additions and 10 deletions

View File

@ -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 }

View File

@ -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 {

View File

@ -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)

View File

@ -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)