aboutsummaryrefslogtreecommitdiffstats
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
commitf6fb95dbf5fce38b18c5ce0a88489ee16520006d (patch)
treed3464fcc8910485a972d3b5a1428f0d95258261b /thread_pthread.c
parenteda3556ea1c742a7c425db465b9a7d8db5577fe4 (diff)
downloadruby-f6fb95dbf5fce38b18c5ce0a88489ee16520006d.tar.gz
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);