Class BodyLockInterfaceLocking

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class BodyLockInterfaceLocking extends BodyLockInterface
A BodyLockInterface that actually locks bodies.
  • Method Details

    • lockRead

      public SharedMutex lockRead(ConstBodyId bodyId)
      Lock the specified body for reading.
      Specified by:
      lockRead in class BodyLockInterface
      Parameters:
      bodyId - the body to read (not null, unaffected)
      Returns:
      a new mutex
    • lockWrite

      public SharedMutex lockWrite(ConstBodyId bodyId)
      Lock the specified body for writing.
      Specified by:
      lockWrite in class BodyLockInterface
      Parameters:
      bodyId - the body to write (not null, unaffected)
      Returns:
      a new mutex
    • unlockRead

      public void unlockRead(SharedMutex mutex)
      Unlock the specified mutex, which was created to read a body.
      Specified by:
      unlockRead in class BodyLockInterface
      Parameters:
      mutex - the mutex to unlock (not null)
    • unlockWrite

      public void unlockWrite(SharedMutex mutex)
      Unlock the specified mutex, which was created to write a body.
      Specified by:
      unlockWrite in class BodyLockInterface
      Parameters:
      mutex - the mutex to unlock (not null)