2010-11-29 19:44:50 +00:00
|
|
|
//=== llvm/Support/Unix/ThreadLocal.inc - Unix Thread Local Data -*- C++ -*-===//
|
2010-11-29 18:16:10 +00:00
|
|
|
//
|
2009-06-25 21:58:01 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2010-11-29 18:16:10 +00:00
|
|
|
//
|
2009-06-25 21:58:01 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Unix specific (non-pthread) ThreadLocal class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//=== WARNING: Implementation here must contain only generic UNIX code that
|
|
|
|
//=== is guaranteed to work on *all* UNIX variants.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
using namespace sys;
|
2013-12-19 20:32:44 +00:00
|
|
|
ThreadLocalImpl::ThreadLocalImpl() : data() { }
|
2009-06-25 21:58:01 +00:00
|
|
|
ThreadLocalImpl::~ThreadLocalImpl() { }
|
2009-06-26 08:48:03 +00:00
|
|
|
void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);}
|
|
|
|
const void* ThreadLocalImpl::getInstance() { return data; }
|
2010-07-28 22:49:43 +00:00
|
|
|
void ThreadLocalImpl::removeInstance() { setInstance(0); }
|
2009-06-26 08:48:03 +00:00
|
|
|
}
|