code: def test_locks_parallel_multithreading(config: LockingConfig) -> None:
      thread_cnt = 3
      repeats = 100
  
      temp_dir = Path(tempfile.TemporaryDirectory().name)
      temp_dir.mkdir(parents=True, exist_ok=True)
      temp_file = temp_dir / "dbg.txt"
      if temp_file.exists():
          temp_file.unlink()
  
      with open(temp_file, "w") as f:
          f.write("0")
  
      config.timeout = 10
      lock = SyftLock(config)
  
      def _kv_cbk(tid: int) -> None:
          for _idx in range(repeats):
              locked = lock.acquire()
              if not locked:
                  continue
  
              for _retry in range(10):
                  try:
                      with open(temp_file) as f:
                          prev = f.read()
                          prev = int(prev)
                      with open(temp_file, "w") as f:
                          f.write(str(prev + 1))
                          f.flush()
                      break
                  except BaseException as e:
                      print("failed ", e)
  
              lock.release()
  
      tids = []
      for tid in range(thread_cnt):
          thread = Thread(target=_kv_cbk, args=(tid,))
          thread.start()
  
          tids.append(thread)
  
      for thread in tids:
          thread.join()
  
      with open(temp_file) as f:
          stored = int(f.read())
  
      assert stored == thread_cnt * repeats
  
imports: import datetime
  from pathlib import Path
  import random
  import string
  import sys
  import tempfile
  from threading import Thread
  import time
  from joblib import Parallel
  from joblib import delayed
  import pytest
  from pytest_mock_resources import create_redis_fixture
  from syft.store.locks import FileLockingConfig
  from syft.store.locks import LockingConfig
  from syft.store.locks import NoLockingConfig
  from syft.store.locks import RedisLockingConfig
  from syft.store.locks import SyftLock
  from syft.store.locks import ThreadingLockingConfig
label_desc: Use image node_id 17 for calling a global function with example usage: test_locks_parallel_multithreading(config) without return types