code: def acquire_retries_on_intr(self, lock):
      self.sig_recvd = False
  
      def my_handler(signal, frame):
          self.sig_recvd = True
  
      old_handler = signal.signal(signal.SIGUSR1, my_handler)
      try:
  
          def other_thread():
              # Acquire the lock in a non-main thread, so this test works for
              # RLocks.
              lock.acquire()
              # Wait until the main thread is blocked in the lock acquire, and
              # then wake it up with this.
              time.sleep(0.5)
              os.kill(process_pid, signal.SIGUSR1)
              # Let the main thread take the interrupt, handle it, and retry
              # the lock acquisition.  Then we'll let it run.
              time.sleep(0.5)
              lock.release()
  
          with threading_helper.wait_threads_exit():
              thread.start_new_thread(other_thread, ())
              # Wait until we can't acquire it without blocking...
              while lock.acquire(blocking=False):
                  lock.release()
                  time.sleep(0.01)
              result = (
                  lock.acquire()
              )  # Block while we receive a signal.
              self.assertTrue(self.sig_recvd)
              self.assertTrue(result)
      finally:
          signal.signal(signal.SIGUSR1, old_handler)
  
imports: import unittest
  import signal
  import os
  import sys
  from test.support import threading_helper
  import _thread
  import time
label_desc: Use image node_id 6 for calling the ThreadSignals obj's underlying member method code with example usage: obj.acquire_retries_on_intr(lock) without return types