import multiprocessing
from multiprocessing import RLock
def main(locker: RLock) -> None:
pass
if __name__ == '__main__':
lock = RLock()
multiprocessing.Process(target=main, args=(lock,)).start()
multiprocessing.Rlock
хоть и с большой буквы, но это не класс, а функция:Note that RLock is actually a factory function which returns an instance of multiprocessing.synchronize.RLock initialized with a default context.
from multiprocessing.synchronize import RLock
def main(locker: RLock) -> None:
return locker.