diff --git a/docs/api.rst b/docs/api.rst index 6add0568..db39ad99 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -609,8 +609,8 @@ Broker Class :members: -Corker Class -============ +Fork Safety +=========== .. currentmodule:: mitogen.os_fork .. autoclass:: Corker diff --git a/mitogen/os_fork.py b/mitogen/os_fork.py index 3dbfbcdf..55739877 100644 --- a/mitogen/os_fork.py +++ b/mitogen/os_fork.py @@ -86,7 +86,7 @@ class Corker(object): In a mixed threading/forking environment, it is critical no threads are active at the moment of fork, as they could hold mutexes whose state is unrecoverably snapshotted in the locked state in the fork child, causing - random deadlocks at random future moments. + deadlocks at random future moments. To ensure a target thread has all locks dropped, we ask it to write a large string to a socket with a small buffer that has :data:`os.O_NONBLOCK`