Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 76ff78e

Browse files
committed
feat: enable fair locking for player data container
- Updated `ppdcReentrantLock` initialization in `CommonCloudPlayerImpl` to use fair locking, improving thread coordination.
1 parent 795db6d commit 76ff78e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/player/CommonCloudPlayerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class CommonCloudPlayerImpl(uuid: UUID, override val name: String) :
1818
CommonOfflineCloudPlayerImpl(uuid), CloudPlayer {
1919

2020
protected val ppdc = TrackingPlayerPersistentDataContainerImpl()
21-
protected val ppdcReentrantLock = ReentrantReadWriteLock()
21+
protected val ppdcReentrantLock = ReentrantReadWriteLock(true)
2222
protected val persistentDataView = object : PersistentPlayerDataContainerViewImpl() {
2323
override fun toTagCompound() = ppdcReentrantLock.read { ppdc.tag }
2424
override fun getTag(key: String) = ppdcReentrantLock.read { ppdc.getTag(key) }

0 commit comments

Comments
 (0)