Misc improvements

This commit is contained in:
Him188 2020-07-11 20:12:28 +08:00
parent 0a50674f67
commit 561df66d1c

View File

@ -112,9 +112,11 @@ public interface AutoSaveSettingHolder : SettingHolder, CoroutineScope {
*/ */
public open class AutoSaveSetting(private val owner: AutoSaveSettingHolder, private val storage: SettingStorage) : public open class AutoSaveSetting(private val owner: AutoSaveSettingHolder, private val storage: SettingStorage) :
AbstractSetting() { AbstractSetting() {
@JvmField
@Volatile @Volatile
internal var lastAutoSaveJob: Job? = null internal var lastAutoSaveJob: Job? = null
@JvmField
@Volatile @Volatile
internal var currentFirstStartTime = atomic(0L) internal var currentFirstStartTime = atomic(0L)
@ -137,7 +139,7 @@ public interface AutoSaveSettingHolder : SettingHolder, CoroutineScope {
} }
} }
final override fun onValueChanged(value: Value<*>) { public final override fun onValueChanged(value: Value<*>) {
lastAutoSaveJob = owner.launch(block = updaterBlock) lastAutoSaveJob = owner.launch(block = updaterBlock)
} }