Skip to content

Commit 41d7b79

Browse files
committed
use _gettid in multiprocessing/utils.Finalize
1 parent 4a953bb commit 41d7b79

File tree

1 file changed

+10
-4
lines changed
  • graalpython/lib-python/3/multiprocessing

1 file changed

+10
-4
lines changed

graalpython/lib-python/3/multiprocessing/util.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from . import process
2020

2121
# Begin Truffle change
22-
from _multiprocessing import _close
22+
from _multiprocessing import _close, _gettid
2323
# End Truffle change
2424

2525
__all__ = [
@@ -202,15 +202,21 @@ def __init__(self, obj, callback, args=(), kwargs=None, exitpriority=None):
202202
self._args = args
203203
self._kwargs = kwargs or {}
204204
self._key = (exitpriority, next(_finalizer_counter))
205-
self._pid = os.getpid()
206-
205+
# Begin Truffle change
206+
# self._pid = os.getpid()
207+
self._pid = _gettid()
208+
# End Truffle change
209+
207210
_finalizer_registry[self._key] = self
208211

209212
def __call__(self, wr=None,
210213
# Need to bind these locally because the globals can have
211214
# been cleared at shutdown
212215
_finalizer_registry=_finalizer_registry,
213-
sub_debug=sub_debug, getpid=os.getpid):
216+
# Begin Truffle change
217+
#sub_debug=sub_debug, getpid=os.getpid):
218+
sub_debug=sub_debug, getpid=_gettid):
219+
# Begin Truffle change
214220
'''
215221
Run the callback unless it has already been called or cancelled
216222
'''

0 commit comments

Comments
 (0)