1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-08 23:42:08 +03:00

Move RealCall and RealConnection to loom safe locks (#8290)

This commit is contained in:
Yuri Schimke
2024-04-15 08:37:21 +01:00
committed by GitHub
parent ce28a31379
commit a673f45ba6
11 changed files with 418 additions and 354 deletions

View File

@@ -31,6 +31,7 @@ import javax.net.SocketFactory
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLSocketFactory
import kotlin.concurrent.withLock
import okhttp3.internal.RecordingOkAuthenticator
import okhttp3.internal.concurrent.TaskFaker
import okhttp3.internal.concurrent.TaskRunner
@@ -93,7 +94,7 @@ class TestValueFactory : Closeable {
socket = Socket(),
idleAtNs = idleAtNanos,
)
synchronized(result) { pool.put(result) }
result.lock.withLock { pool.put(result) }
return result
}