2009-06-25 21:58:01 +00:00
|
|
|
//=== llvm/System/Unix/ThreadLocal.inc - Unix Thread Local Data -*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
ThreadLocalImpl::ThreadLocalImpl() { }
|
|
|
|
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
|
|
|
}
|