__init__.py 398 B

12345678910111213141516
  1. import os
  2. import sys
  3. from .context import get_context
  4. if sys.version_info > (3, 4):
  5. def _make_name():
  6. name = '/loky-%i-%s' % (os.getpid(), next(synchronize.SemLock._rand))
  7. return name
  8. # monkey patch the name creation for multiprocessing
  9. from multiprocessing import synchronize
  10. synchronize.SemLock._make_name = staticmethod(_make_name)
  11. __all__ = ["get_context"]