summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 21:48:32 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 21:48:32 +0000
commit86d35a6b1a001356bf531ef8ff595339622c32c1 (patch)
treed3464fcc8910485a972d3b5a1428f0d95258261b /thread_pthread.c
parent508f00314f46c08b6e9b0141c01355d24954260c (diff)
thread_pthread.c (unregister_ubf_list): assert unblock.func is unset
We must not allow reentry into ubf_list_head once we delete ourselves, otherwise we could hang in there forever. [ruby-core:88218] [Bug #14945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 844a4bc800..c8487e55f1 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1178,6 +1178,9 @@ unregister_ubf_list(rb_thread_t *th)
{
struct list_node *node = &th->native_thread_data.ubf_list;
+ /* we can't allow re-entry into ubf_list_head */
+ VM_ASSERT(th->unblock.func == 0);
+
if (!list_empty((struct list_head*)node)) {
rb_native_mutex_lock(&ubf_list_lock);
list_del_init(node);