Source code for mpservice.multiprocessing.synchronize
import multiprocessing
from .context import MP_SPAWN_CTX
[docs]
class Lock(multiprocessing.synchronize.Lock):
[docs]
def __init__(self, *, ctx=None):
super().__init__(ctx=ctx or MP_SPAWN_CTX)
[docs]
class RLock(multiprocessing.synchronize.RLock):
[docs]
def __init__(self, *, ctx=None):
super().__init__(ctx=ctx or MP_SPAWN_CTX)
[docs]
class Condition(multiprocessing.synchronize.Condition):
[docs]
def __init__(self, lock=None, *, ctx=None):
super().__init__(lock=lock, ctx=ctx or MP_SPAWN_CTX)
[docs]
class Semaphore(multiprocessing.synchronize.Semaphore):
[docs]
def __init__(self, value=1, *, ctx=None):
super().__init__(value=value, ctx=ctx or MP_SPAWN_CTX)
[docs]
class BoundedSemaphore(multiprocessing.synchronize.BoundedSemaphore):
[docs]
def __init__(self, value=1, *, ctx=None):
super().__init__(value=value, ctx=ctx or MP_SPAWN_CTX)
[docs]
class Event(multiprocessing.synchronize.Event):
[docs]
def __init__(self, *, ctx=None):
super().__init__(ctx=ctx or MP_SPAWN_CTX)
[docs]
class Barrier(multiprocessing.synchronize.Barrier):
[docs]
def __init__(self, *args, ctx=None, **kwargs):
super().__init__(*args, ctx=ctx or MP_SPAWN_CTX, **kwargs)