Package com.github.stephengold.joltjni
Class BodyLockInterfaceLocking
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BodyLockInterface
com.github.stephengold.joltjni.BodyLockInterfaceLocking
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A
BodyLockInterface
that actually locks bodies.-
Method Summary
Modifier and TypeMethodDescriptionlockRead
(int bodyId) Lock the specified body for reading.lockWrite
(int bodyId) Lock the specified body for writing.void
unlockRead
(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.void
unlockWrite
(SharedMutex mutex) Unlock the specified mutex, which was created to write a body.Methods inherited from class com.github.stephengold.joltjni.BodyLockInterface
getSystem
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
lockRead
Lock the specified body for reading.- Specified by:
lockRead
in classBodyLockInterface
- Parameters:
bodyId
- the ID of the body to read- Returns:
- a new mutex
-
lockWrite
Lock the specified body for writing.- Specified by:
lockWrite
in classBodyLockInterface
- Parameters:
bodyId
- the ID of the body to write- Returns:
- a new mutex
-