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<ConstJoltPhysicsObject>
A
BodyLockInterface that actually locks bodies.-
Method Summary
Modifier and TypeMethodDescriptionlockRead(ConstBodyId bodyId) Lock the specified body for reading.lockWrite(ConstBodyId bodyId) Lock the specified body for writing.voidunlockRead(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.voidunlockWrite(SharedMutex mutex) Unlock the specified mutex, which was created to write a body.Methods inherited from class com.github.stephengold.joltjni.BodyLockInterface
getSystemMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
lockRead
Lock the specified body for reading.- Specified by:
lockReadin classBodyLockInterface- Parameters:
bodyId- the body to read (not null, unaffected)- Returns:
- a new mutex
-
lockWrite
Lock the specified body for writing.- Specified by:
lockWritein classBodyLockInterface- Parameters:
bodyId- the body to write (not null, unaffected)- Returns:
- a new mutex
-