Skip to content

Commit 77d82ae

Browse files
committed
Removed unnecessary main-thread checking
1 parent c3da2c5 commit 77d82ae

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

line_profiler/_line_profiler.pyx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ cdef inline object multibyte_rstrip(bytes bytecode):
174174
return (unpadded, npad)
175175

176176

177-
cdef inline int is_main_thread():
178-
return <int>(threading.current_thread() == threading.main_thread())
179-
180-
181177
cdef inline object get_current_callback(int event_id):
182178
"""
183179
Note:
@@ -336,8 +332,6 @@ cdef class _SysMonitoringState:
336332
# - Since our callbacks are registered globally for events,
337333
# there is no risk of events being disrupted by the wrapped
338334
# callback's returning `sys.monitoring.DISABLE`
339-
if not is_main_thread():
340-
return
341335
mon = sys.monitoring
342336

343337
# Set prior state
@@ -363,8 +357,6 @@ cdef class _SysMonitoringState:
363357
mon.PROFILER_ID, event_id, callback)
364358

365359
cpdef deregister(self):
366-
if not is_main_thread():
367-
return
368360
mon = sys.monitoring
369361
cdef dict wrapped_callbacks = self.callbacks
370362

0 commit comments

Comments
 (0)