Class ObjectMutex

java.lang.Object
com.compomics.util.threading.ObjectMutex

public class ObjectMutex
extends Object
This mutex can be used to manage threads editing experiment objects using their key.
Author:
Marc Vaudel
  • Constructor Details

  • Method Details

    • acquire

      public void acquire​(long key)
      Acquire function for the given key. If a thread gets interrupted an exception is thrown as runtime exception.
      Parameters:
      key - the object key
    • acquire

      public void acquire​(String key)
      Acquire function for the given key. If a thread gets interrupted an exception is thrown as runtime exception.
      Parameters:
      key - the object key
    • release

      public void release​(long key)
      Release function for the given key.
      Parameters:
      key - the object key
    • release

      public void release​(String key)
      Release function for the given key.
      Parameters:
      key - the object key