Skip to content

Commit

Permalink
Merge pull request #5433 from zqkkqz/master
Browse files Browse the repository at this point in the history
common/Thread: pthread_attr_destroy(thread_attr) when done with it

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
liewegas committed Aug 19, 2015
2 parents a0ae5bc + 9471bb8 commit 49c3119
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/Thread.cc
Expand Up @@ -136,6 +136,10 @@ int Thread::try_create(size_t stacksize)
r = pthread_create(&thread_id, thread_attr, _entry_func, (void*)this);
restore_sigset(&old_sigset);

if (thread_attr) {
pthread_attr_destroy(thread_attr);
}

return r;
}

Expand Down

0 comments on commit 49c3119

Please sign in to comment.