diff options
author | Owen Anderson <resistor@mac.com> | 2009-06-25 21:58:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-06-25 21:58:01 +0000 |
commit | f17f6f06faa4c034c9b0f778b99839978c87fa4b (patch) | |
tree | 5df8cda8bb8760bc4713320ef4b56fcaf341aa2b /llvm/lib/System/Unix/ThreadLocal.inc | |
parent | 2d2ee150eb48229140ef5fd669dc00d835b648ab (diff) | |
download | bcm5719-llvm-f17f6f06faa4c034c9b0f778b99839978c87fa4b.tar.gz bcm5719-llvm-f17f6f06faa4c034c9b0f778b99839978c87fa4b.zip |
Add a class for supporting platform independent thread-local storage.
Windows people, please double-check/patch this.
llvm-svn: 74209
Diffstat (limited to 'llvm/lib/System/Unix/ThreadLocal.inc')
-rw-r--r-- | llvm/lib/System/Unix/ThreadLocal.inc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/ThreadLocal.inc b/llvm/lib/System/Unix/ThreadLocal.inc new file mode 100644 index 00000000000..6ee840d7255 --- /dev/null +++ b/llvm/lib/System/Unix/ThreadLocal.inc @@ -0,0 +1,25 @@ +//=== 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() { } +void ThreadLocalImpl::setInstance(void* d) { data = d; } +void* ThreadLocalImpl::getInstance() { return data; } +}
\ No newline at end of file |