Drop fixed workaround

This commit is contained in:
FooIbar committed 2024-01-03 15:10:37 +08:00
1 parent 6274b39b68
commit 76223a2cd2
3 files changed
+7 -17

No files matched your search

@@ -602,19 +602,15 @@ class SpiderQueen private constructor(val galleryInfo: GalleryInfo) : CoroutineS
}
}
val previousPToken: String?
val pToken: String?
val pToken: String
pTokenLock.withLock {
// Non-local return will not release the lock
// https://github.com/Kotlin/kotlinx.coroutines/issues/3985
pToken = getPToken(index)
if (pToken == null) {
updatePageState(index, STATE_FAILED, PTOKEN_FAILED_MESSAGE)
mSpiderInfo.pTokenMap[index] = TOKEN_FAILED
}
?: return updatePageState(index, STATE_FAILED, PTOKEN_FAILED_MESSAGE).also {
mSpiderInfo.pTokenMap[index] = TOKEN_FAILED
}
previousPToken = getPToken(index - 1)
}
pToken ?: return
delayLock.withLock {
delay(mDownloadDelay - lastRequestTime.elapsedNow())
@@ -4,6 +4,7 @@ import arrow.core.memoize
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
class NamedMutex<T> {
val innerMutexGetter = { _: T -> Mutex() }.memoize()
@@ -18,12 +19,5 @@ suspend inline fun <T, K> NamedMutex<K>.withLock(key: K, owner: Any? = null, act
innerMutexGetter(key)
}
mutex.run {
lock(owner)
try {
return action()
} finally {
unlock(owner)
}
}
return mutex.withLock(owner, action)
}
+1 -1
View File
@@ -22,7 +22,7 @@ compose-compiler = "1.5.8-dev-k2.0.0-Beta2-99ed868a0f8"
compose-destinations = "1.9.56"
google-android-material = "1.12.0-alpha02"
kotlin = "2.0.0-Beta2"
kotlinx-coroutines = "1.7.3"
kotlinx-coroutines = "1.8.0-RC2"
kotlinx-datetime = "0.5.0"
kotlinx-serialization = "1.6.2"
ksp = "2.0.0-Beta2-1.0.16"