code: def test_thread_serialization() -> None:
      # expect that two run calls on the same runner with a non-generator-protocol
      # do not create a runtime error (executions are serialized though)
  
      exceptions = _reentry_detection_run(StdOutCapture, True)
      assert exceptions == []
  
imports: from __future__ import annotations
  import random
  import threading
  import time
  from threading import Thread
  from datalad.tests.utils_pytest import assert_raises
  from ..coreprotocols import StdOutCapture
  from ..nonasyncrunner import ThreadedRunner
  from ..protocol import GeneratorMixIn, WitlessProtocol
  from .utils import py2cmd
label_desc: Use image node_id 5 for calling a global function with example usage: test_thread_serialization() without return types