code: def start_lock_thread():
      """Start the thread that handles file locking"""
      global __lock_thread
      if __lock_thread is not None:
          return
      the_boundary.register_request_class(
          LockStatusRequest, __lock_queue
      )
  
      def lock_thread_fn():
          global __lock_thread
          locked_uids = {}
          locked_files = {}
          while True:
              msg = __lock_queue.get()
              boundary = msg[0]
              if msg[1] == Boundary.NOTIFY_STOP:
                  msg[2].put(__lock_thread)
                  break
              elif msg[1] == Boundary.NOTIFY_REQUEST:
                  request = msg[2]
                  assert isinstance(request, LockStatusRequest)
                  assert isinstance(boundary, Boundary)
                  LOGGER.info(
                      "Received lock status request for %s"
                      % request.uid
                  )
                  reply = LockStatusReply(
                      request.uid, request.uid in locked_uids
                  )
                  if reply.locked:
                      LOGGER.info(
                          "Denied lock request for %s"
                          % locked_uids[request.uid]
                      )
                  boundary.enqueue_reply(request, reply)
              elif msg[1] == LOCK_REQUEST:
                  uid, path = msg[2]
                  locked_uids[uid] = path
                  locked_files[path] = uid
                  msg[3].put("OK")
              elif msg[1] == UNLOCK_REQUEST:
                  try:
                      uid = locked_files[msg[2]]
                      del locked_uids[uid]
                      del locked_files[msg[2]]
                      msg[3].put("OK")
                  except Exception as e:
                      msg[3].put(e)
          __lock_thread = None
          LOGGER.info("Exiting the lock thread")
  
      __lock_thread = threading.Thread(target=lock_thread_fn)
      __lock_thread.setName("FileLockThread")
      __lock_thread.start()
  
imports: import errno
  import json
  import logging
  import os
  import queue
  import sys
  import threading
  import uuid
  import numpy
  import zmq
  import cellprofiler_core.utilities.grid
  from cellprofiler_core.utilities.zmq._boundary import Boundary
  from cellprofiler_core.utilities.zmq.communicable.reply import LockStatusReply, Reply
  from cellprofiler_core.utilities.zmq.communicable.request import LockStatusRequest, Request
label_desc: Use image node_id 13 for calling a global function with example usage: start_lock_thread() without return types