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 21
21
from . import process
22
22
from . import util
23
23
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?
27
25
try :
28
26
from _multiprocessing import SemLock , sem_unlink
29
- except ( ImportError ) :
27
+ except ImportError :
30
28
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." )
34
30
35
31
#
36
32
# Constants
37
33
#
38
34
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
+
40
39
SEM_VALUE_MAX = _multiprocessing .SemLock .SEM_VALUE_MAX
41
40
42
41
#
Original file line number Diff line number Diff line change 15
15
16
16
#ifdef HAVE_MP_SEMAPHORE
17
17
18
+ // These match the values in Lib/multiprocessing/synchronize.py
18
19
enum { RECURSIVE_MUTEX , SEMAPHORE };
19
20
20
21
typedef struct {
You can’t perform that action at this time.
0 commit comments