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:
ConstBodyLockInterface,ConstBodyLockInterfaceLocking,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
public class BodyLockInterfaceLocking
extends BodyLockInterface
implements ConstBodyLockInterfaceLocking
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.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, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstBodyLockInterface
getSystemMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
lockRead
Lock the specified body for reading.- Specified by:
lockReadin interfaceConstBodyLockInterface- Specified by:
lockReadin classBodyLockInterface- Parameters:
bodyId- the ID of the body to read- Returns:
- a new mutex
-
lockWrite
Lock the specified body for writing.- Specified by:
lockWritein interfaceConstBodyLockInterface- Specified by:
lockWritein classBodyLockInterface- Parameters:
bodyId- the ID of the body to write- Returns:
- a new mutex
-