File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 2121from . import process
2222from . import util
2323
24- # Try to import the mp.synchronize module cleanly, if it fails
25- # raise ImportError for platforms lacking a working sem_open implementation.
26- # See issue 3770
24+ # TODO: Do any platforms still lack a functioning sem_open?
2725try :
2826 from _multiprocessing import SemLock , sem_unlink
29- except ( ImportError ) :
27+ except ImportError :
3028 raise ImportError ("This platform lacks a functioning sem_open" +
31- " implementation, therefore, the required" +
32- " synchronization primitives needed will not" +
33- " function, see issue 3770." )
29+ " implementation. https://github.com/python/cpython/issues/48020." )
3430
3531#
3632# Constants
3733#
3834
39- RECURSIVE_MUTEX , SEMAPHORE = list (range (2 ))
35+ # These match the enum in Modules/_multiprocessing/semaphore.c
36+ RECURSIVE_MUTEX = 0
37+ SEMAPHORE = 1
38+
4039SEM_VALUE_MAX = _multiprocessing .SemLock .SEM_VALUE_MAX
4140
4241#
Original file line number Diff line number Diff line change 1515
1616#ifdef HAVE_MP_SEMAPHORE
1717
18+ // These match the values in Lib/multiprocessing/synchronize.py
1819enum { RECURSIVE_MUTEX , SEMAPHORE };
1920
2021typedef struct {
You can’t perform that action at this time.
0 commit comments