From 73a7dd2818c8eb2d46b2065347030691bfc8140a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 May 2012 15:24:13 +0000 Subject: Fix Thread::get() when called before any Thread is created. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4378 a436a847-0d15-0410-975c-d299462d15a1 --- src/Thread.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Thread.cpp b/src/Thread.cpp index e35d347..a2d79c3 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -79,6 +79,7 @@ Thread::create_for_this_thread(const std::string& name) Thread& Thread::get() { + pthread_once(&s_thread_key_once, thread_key_alloc); Thread* this_thread = reinterpret_cast( pthread_getspecific(s_thread_key)); if (!this_thread) -- cgit v1.2.1