Lock Requests

The Lock requests provide support to the following criteria:

  • A key identifying the lock.
  • A timeout in seconds:
    • "0", to request immediate lock, which means the lock request is either successful and grants the lock right away, or returns an error.
    • Non-zero, to request a lock that can be delayed. If the lock cannot be granted right away, it is delayed by the entity. If the entity is released before getting timed out, the lock is granted to the requester. Otherwise, the lock request gets timed out and the request is discarded.
  • A priority (higher the value, higher the priority). When a lock is released and there are delayed lock requests, the system grants the lock to the request with the higher priority. If the priority value is the same for many requests then the priority placed earlier gets the lock.