code: def test_threading():
      import _thread
  
      def hook(event, args):
          if event.startswith(
              ("_thread.", "cpython.PyThreadState", "test.")
          ):
              print(event, args)
  
      sys.addaudithook(hook)
  
      lock = _thread.allocate_lock()
      lock.acquire()
  
      class test_func:
          def __repr__(self):
              return "<test_func>"
  
          def __call__(self):
              sys.audit("test.test_func")
              lock.release()
  
      i = _thread.start_new_thread(test_func(), ())
      lock.acquire()
  
      handle = _thread.start_joinable_thread(test_func())
      handle.join()
  
imports: import contextlib
  import os
  import sys
label_desc: Use image node_id 24 for calling a global function with example usage: test_threading() and returns: str