monotone

monotone Mtn Source Tree

Root/cryptopp/trdlocal.h

1#ifndef CRYPTOPP_TRDLOCAL_H
2#define CRYPTOPP_TRDLOCAL_H
3
4#include "config.h"
5
6#ifdef THREADS_AVAILABLE
7
8#include "misc.h"
9
10#ifdef HAS_WINTHREADS
11#include <windows.h>
12typedef DWORD ThreadLocalIndexType;
13#else
14#include <pthread.h>
15typedef pthread_key_t ThreadLocalIndexType;
16#endif
17
18NAMESPACE_BEGIN(CryptoPP)
19
20//! thread local storage
21class ThreadLocalStorage : public NotCopyable
22{
23public:
24//! exception thrown by ThreadLocalStorage class
25class Err : public OS_Error
26{
27public:
28Err(const std::string& operation, int error);
29};
30
31ThreadLocalStorage();
32~ThreadLocalStorage();
33
34void SetValue(void *value);
35void *GetValue() const;
36
37private:
38ThreadLocalIndexType m_index;
39};
40
41NAMESPACE_END
42
43#endif// #ifdef THREADS_AVAILABLE
44
45#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status