File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
graalpython/lib-python/3/multiprocessing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import _multiprocessing
22
22
23
+ import threading
23
24
from . import util
24
25
25
26
from . import AuthenticationError , BufferTooShort
@@ -77,11 +78,13 @@ def arbitrary_address(family):
77
78
# size. When coding portable applications, some implementations have
78
79
# sun_path as short as 92 bytes in the sockaddr_un struct.
79
80
if util .abstract_sockets_supported :
80
- return f"\0 listener-{ os .getpid ()} -{ next (_mmap_counter )} "
81
+ # GraalVM change: add thread ID, we may be in the same process
82
+ return f"\0 listener-{ os .getpid ()} -{ threading .current_thread ().native_id } -{ next (_mmap_counter )} "
81
83
return tempfile .mktemp (prefix = 'listener-' , dir = util .get_temp_dir ())
82
84
elif family == 'AF_PIPE' :
83
- return tempfile .mktemp (prefix = r'\\.\pipe\pyc-%d-%d-' %
84
- (os .getpid (), next (_mmap_counter )), dir = "" )
85
+ # GraalVM change: add thread ID, we may be in the same process
86
+ return tempfile .mktemp (prefix = r'\\.\pipe\pyc-%d-%d-%d-' %
87
+ (os .getpid (), threading .current_thread ().native_id , next (_mmap_counter )), dir = "" )
85
88
else :
86
89
raise ValueError ('unrecognized family' )
87
90
You can’t perform that action at this time.
0 commit comments