class_docstr: Abstract base class for a file lock object.
docstr: Create a new lock object.
  
  :param lock_file: path to the file
  :param timeout: default timeout when acquiring the lock. It will be used as fallback value in the acquire
  method, if no timeout value (``None``) is given. If you want to disable the timeout, set it to a negative value.
   A timeout of 0 means, that there is exactly one attempt to acquire the file lock.
docstr_tok: ["Create","a","new","lock","object",".",":","param","lock_file",":","path","to","the","file",":","param","timeout",":","default","timeout","when","acquiring","the","lock",".","It","will","be","used","as","fallback","value","in","the","acquire","method",",","if","no","timeout","value","(","``","None","``",")","is","given",".","If","you","want","to","disable","the","timeout",",","set","it","to","a","negative","value",".","A","timeout","of","0","means",",","that","there","is","exactly","one","attempt","to","acquire","the","file","lock","."]
code: def __init__(self, lock_file, timeout=-1):
      """
      Create a new lock object.
  
      :param lock_file: path to the file
      :param timeout: default timeout when acquiring the lock. It will be used as fallback value in the acquire
      method, if no timeout value (``None``) is given. If you want to disable the timeout, set it to a negative value.
       A timeout of 0 means, that there is exactly one attempt to acquire the file lock.
      """
      # The path to the lock file.
      self._lock_file = lock_file
  
      # The file descriptor for the *_lock_file* as it is returned by the os.open() function.
      # This file lock is only NOT None, if the object currently holds the lock.
      self._lock_file_fd = None
  
      # The default timeout value.
      self.timeout = timeout
  
      # We use this lock primarily for the lock counter.
      self._thread_lock = Lock()
  
      # The lock counter is used for implementing the nested locking mechanism. Whenever the lock is acquired, the
      # counter is increased and the lock is only released, when this value is 0 again.
      self._lock_counter = 0
  
imports: import logging
  import time
  from threading import Lock
  from ._error import Timeout
label_desc: Use image node_id 1 to create a new BaseFileLock object from inherited base classes: object with example: obj = BaseFileLock(lock_file, timeout)