summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-12 15:24:13 +0000
committerDavid Robillard <d@drobilla.net>2012-05-12 15:24:13 +0000
commit73a7dd2818c8eb2d46b2065347030691bfc8140a (patch)
treec9cdb0716a8435e726923b12627f0c59bd48f23c /src
parentff66c64ebad0761c726ef52b95ec4f2b41c9b853 (diff)
downloadraul-73a7dd2818c8eb2d46b2065347030691bfc8140a.tar.gz
raul-73a7dd2818c8eb2d46b2065347030691bfc8140a.tar.bz2
raul-73a7dd2818c8eb2d46b2065347030691bfc8140a.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/Thread.cpp1
1 files changed, 1 insertions, 0 deletions
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<Thread*>(
pthread_getspecific(s_thread_key));
if (!this_thread)