generated from JetBrains/compose-multiplatform-template
-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Use Compose
AtomicReference
instead of `InternalAtomicRefer…
…ence` in `InternalMutatorMutex`" This reverts commit b95a5ab.
- Loading branch information
1 parent
eaa0d5d
commit a79cc6f
Showing
3 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...d/src/androidMain/kotlin/dev/sasikanth/rss/reader/components/bottomsheet/ActualAndroid.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2020 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package dev.sasikanth.rss.reader.components.bottomsheet | ||
|
||
import java.util.concurrent.atomic.AtomicReference | ||
|
||
internal actual typealias InternalAtomicReference<V> = AtomicReference<V> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
shared/src/iosMain/kotlin/dev/sasikanth/rss/reader/components/bottomsheet/ActualIOS.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2023 Sasikanth Miriyampalli | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package dev.sasikanth.rss.reader.components.bottomsheet | ||
|
||
import kotlin.native.concurrent.AtomicReference | ||
|
||
actual class InternalAtomicReference<V> actual constructor(value: V) { | ||
|
||
private val atomicReference = AtomicReference(value) | ||
|
||
actual fun get(): V { | ||
return atomicReference.value | ||
} | ||
|
||
actual fun set(value: V) { | ||
atomicReference.value = value | ||
} | ||
|
||
actual fun compareAndSet(expect: V, newValue: V): Boolean { | ||
return atomicReference.compareAndSet(expect, newValue) | ||
} | ||
} |