summaryrefslogtreecommitdiffstats
path: root/src/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Thread.cpp')
-rw-r--r--src/Thread.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Thread.cpp b/src/Thread.cpp
index 88919d2..e35d347 100644
--- a/src/Thread.cpp
+++ b/src/Thread.cpp
@@ -76,17 +76,13 @@ Thread::create_for_this_thread(const std::string& name)
return new Thread(pthread_self(), name);
}
-/** Return the calling thread.
- * The return value of this should NOT be cached unless the thread is
- * explicitly user created with create().
- */
Thread&
Thread::get()
{
Thread* this_thread = reinterpret_cast<Thread*>(
pthread_getspecific(s_thread_key));
if (!this_thread)
- this_thread = new Thread(); // sets thread-specific data
+ this_thread = create_for_this_thread("");
return *this_thread;
}