aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 19:26:52 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 19:26:52 +0000
commit14e8a7c057be1638437e6efcba356dfc59398914 (patch)
treef63c3c3e5e9afee8af5fc9acb9ef103dad4ca662 /thread_pthread.c
parent15b6ba2181abab4c6924a894ac5028e6ff70f4a8 (diff)
downloadruby-14e8a7c057be1638437e6efcba356dfc59398914.tar.gz
* thread_pthread.c (rb_thread_create_timer_thread): destroy attr even
if pthread_create() failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 46cc5715c4..738ad57ce0 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1599,6 +1599,7 @@ rb_thread_create_timer_thread(void)
}
#ifdef HAVE_PTHREAD_ATTR_INIT
err = pthread_create(&timer_thread.id, &attr, thread_timer, &GET_VM()->gvl);
+ pthread_attr_destroy(&attr);
#else
err = pthread_create(&timer_thread.id, NULL, thread_timer, &GET_VM()->gvl);
#endif
@@ -1617,9 +1618,6 @@ rb_thread_create_timer_thread(void)
/* validate pipe on this process */
timer_thread_pipe.owner_process = getpid();
timer_thread.created = 1;
-#ifdef HAVE_PTHREAD_ATTR_INIT
- pthread_attr_destroy(&attr);
-#endif
}
}