Skip to content

Commit

Permalink
Remove usage of the deprecated freeze function
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Jan 8, 2025
1 parent ffcd387 commit 3a2858f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ktor-io/posix/src/io/ktor/utils/io/locks/Synchronized.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package io.ktor.utils.io.locks

import io.ktor.io.interop.mutex.*
import io.ktor.utils.io.*
import kotlinx.cinterop.*
import platform.posix.*
import platform.posix.pthread_self
import platform.posix.pthread_t
import kotlin.concurrent.AtomicNativePtr
import kotlin.concurrent.AtomicReference
import kotlin.native.concurrent.*
import kotlin.native.internal.NativePtr

/**
Expand Down Expand Up @@ -217,18 +217,13 @@ public actual open class SynchronizedObject {
}
}

@OptIn(FreezingIsDeprecated::class)
protected class LockState(
public val status: Status,
public val nestedLocks: Int,
public val waiters: Int,
public val ownerThreadId: pthread_t? = null,
public val mutex: CPointer<ktor_mutex_node_t>? = null
) {
init {
freeze()
}
}
)

protected enum class Status { UNLOCKED, THIN, FAT }

Expand Down

0 comments on commit 3a2858f

Please sign in to comment.