From 0a66ca72ef807e7d0107a7536594f7f5fa241503 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 18 Feb 2019 18:22:32 +0000 Subject: [PATCH] os_fork: more doc tweaks --- docs/api.rst | 4 ++-- mitogen/os_fork.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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`