| 84 | |
| 85 | private: |
| 86 | class CurrentThreadHolder |
| 87 | { |
| 88 | public: |
| 89 | CurrentThreadHolder(): _slot(TlsAlloc()) |
| 90 | { |
| 91 | if (_slot == TLS_OUT_OF_INDEXES) |
| 92 | throw std::exception("cannot allocate thread context key"); |
| 93 | } |
| 94 | ~CurrentThreadHolder() |
| 95 | { |
| 96 | TlsFree(_slot); |
| 97 | } |
| 98 | Thread* get() const |
| 99 | { |
| 100 | return reinterpret_cast<Thread*>(TlsGetValue(_slot)); |
| 101 | } |
| 102 | void set(Thread* pThread) |
| 103 | { |
| 104 | TlsSetValue(_slot, pThread); |
| 105 | } |
| 106 | |
| 107 | private: |
| 108 | DWORD _slot; |
| 109 | }; |
| 110 | |
| 111 | Runnable* _pRunnableTarget; |
| 112 | CallbackData _callbackTarget; |
nothing calls this directly
no outgoing calls
no test coverage detected