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

public class Mutex extends JoltPhysicsObject
Protect shared data from being accessed simultaneously by multiple threads.
  • Constructor Details

    • Mutex

      public Mutex()
      Instantiate a mutex.
  • Method Details

    • lock

      public void lock()
      Acquire the mutex.
    • tryLock

      public boolean tryLock()
      Attempt to acquire the mutex and immediately return false if it's unavailable.
      Returns:
      true if acquired, otherwise false
    • unlock

      public void unlock()
      Release the mutex.