code: def test_locking_same_value(self):
      locks = mlmd_state._LocksManager()
      barrier = threading.Barrier(3, timeout=3.0)
  
      def _func():
          with locks.lock(1):
              barrier.wait()
  
      futs = []
      with futures.ThreadPoolExecutor(max_workers=3) as pool:
          for _ in range(3):
              futs.append(pool.submit(_func))
  
      with self.assertRaises(threading.BrokenBarrierError):
          for fut in futs:
              fut.result()
      self.assertEmpty(locks._refcounts)
  
imports: from concurrent import futures
  import os
  import threading
  import tensorflow
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import test_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 2 for calling the LocksManagerTest obj's underlying member method code with example usage: obj.test_locking_same_value() without return types