Project

General

Profile

Actions

Bug #14945

closed

[PATCH] thread.c (blocking_region_end): clear ubf before unregister_ubf_list

Added by normalperson (Eric Wong) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:88141]

Description

thread.c (blocking_region_end): clear ubf before unregister_ubf_list

If we keep ubf set after unregistering, there is a window for
other threads (including timer thread) to put this thread back
on the ubf_list right away. Entering ubf_list unexpectedly
after GVL acquisition may cause spurious wakeup and trigger
unexpected behavior.

Finally, clear ubf before acquiring GVL, to since ubf is useless
during GVL acquisition anyways and we don't want to waste cycles
in other threads calling ubf for useless work.

I found this bug while rewriting GVL to handle timer-thread duty
and eliminate separate timer thread.


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0