LLVM API Documentation

Unix/ThreadLocal.inc
Go to the documentation of this file.
00001 //=== llvm/Support/Unix/ThreadLocal.inc - Unix Thread Local Data -*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the Unix specific (non-pthread) ThreadLocal class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 //===----------------------------------------------------------------------===//
00015 //=== WARNING: Implementation here must contain only generic UNIX code that
00016 //===          is guaranteed to work on *all* UNIX variants.
00017 //===----------------------------------------------------------------------===//
00018 
00019 namespace llvm {
00020 using namespace sys;
00021 ThreadLocalImpl::ThreadLocalImpl() : data() { }
00022 ThreadLocalImpl::~ThreadLocalImpl() { }
00023 void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);}
00024 const void* ThreadLocalImpl::getInstance() { return data; }
00025 void ThreadLocalImpl::removeInstance() { setInstance(0); }
00026 }