Mark Slee | 9f0c651 | 2007-02-28 23:58:26 +0000 | [diff] [blame] | 1 | // Copyright (c) 2006- Facebook |
| 2 | // Distributed under the Thrift Software License |
| 3 | // |
| 4 | // See accompanying file LICENSE or visit the Thrift site at: |
| 5 | // http://developers.facebook.com/thrift/ |
| 6 | |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 7 | #include "PosixThreadFactory.h" |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 8 | #include "Exception.h" |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 9 | |
| 10 | #include <assert.h> |
| 11 | #include <pthread.h> |
| 12 | |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 13 | #include <iostream> |
| 14 | |
| 15 | #include <boost/weak_ptr.hpp> |
| 16 | |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 17 | namespace facebook { namespace thrift { namespace concurrency { |
| 18 | |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 19 | using namespace boost; |
| 20 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 21 | /** |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 22 | * The POSIX thread class. |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 23 | * |
| 24 | * @author marc |
| 25 | * @version $Id:$ |
| 26 | */ |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 27 | class PthreadThread: public Thread { |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 28 | public: |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 29 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 30 | enum STATE { |
| 31 | uninitialized, |
| 32 | starting, |
| 33 | started, |
| 34 | stopping, |
| 35 | stopped |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | static const int MB = 1024 * 1024; |
| 39 | |
Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame] | 40 | static void* threadMain(void* arg); |
| 41 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 42 | private: |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 43 | pthread_t pthread_; |
| 44 | STATE state_; |
| 45 | int policy_; |
| 46 | int priority_; |
| 47 | int stackSize_; |
| 48 | weak_ptr<PthreadThread> self_; |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 49 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 50 | public: |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 51 | |
| 52 | PthreadThread(int policy, int priority, int stackSize, shared_ptr<Runnable> runnable) : |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 53 | pthread_(0), |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 54 | state_(uninitialized), |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 55 | policy_(policy), |
| 56 | priority_(priority), |
| 57 | stackSize_(stackSize) { |
Marc Slemko | fe5ba12e | 2006-07-20 21:16:27 +0000 | [diff] [blame] | 58 | |
| 59 | this->Thread::runnable(runnable); |
| 60 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 61 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 62 | ~PthreadThread() {} |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 63 | |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 64 | void start() { |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 65 | if (state_ != uninitialized) { |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 66 | return; |
| 67 | } |
| 68 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 69 | state_ = starting; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 70 | |
| 71 | pthread_attr_t thread_attr; |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 72 | if (pthread_attr_init(&thread_attr) != 0) { |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 73 | throw SystemResourceException("pthread_attr_init failed"); |
| 74 | } |
Aditya Agarwal | 9dc5740 | 2007-03-31 17:45:12 +0000 | [diff] [blame] | 75 | |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 76 | if (pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE) != 0) { |
| 77 | throw SystemResourceException("pthread_attr_setdetachstate failed"); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 78 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 79 | |
| 80 | // Set thread stack size |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 81 | if (pthread_attr_setstacksize(&thread_attr, MB * stackSize_) != 0) { |
| 82 | throw SystemResourceException("pthread_attr_setstacksize failed"); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 83 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 84 | |
| 85 | // Set thread policy |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 86 | if (pthread_attr_setschedpolicy(&thread_attr, policy_) != 0) { |
| 87 | throw SystemResourceException("pthread_attr_setschedpolicy failed"); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 88 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 89 | |
| 90 | struct sched_param sched_param; |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 91 | sched_param.sched_priority = priority_; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 92 | |
| 93 | // Set thread priority |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 94 | if (pthread_attr_setschedparam(&thread_attr, &sched_param) != 0) { |
| 95 | throw SystemResourceException("pthread_attr_setschedparam failed"); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 96 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 97 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 98 | // Create reference |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 99 | shared_ptr<PthreadThread>* selfRef = new shared_ptr<PthreadThread>(); |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 100 | *selfRef = self_.lock(); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 101 | |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 102 | if (pthread_create(&pthread_, &thread_attr, threadMain, (void*)selfRef) != 0) { |
| 103 | throw SystemResourceException("pthread_create failed"); |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 104 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | void join() { |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 108 | if (state_ != stopped) { |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 109 | void* ignore; |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 110 | pthread_join(pthread_, &ignore); |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 111 | } |
| 112 | } |
| 113 | |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 114 | id_t id() { |
| 115 | return pthread_; |
| 116 | } |
| 117 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 118 | shared_ptr<Runnable> runnable() const { return Thread::runnable(); } |
Marc Slemko | fe5ba12e | 2006-07-20 21:16:27 +0000 | [diff] [blame] | 119 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 120 | void runnable(shared_ptr<Runnable> value) { Thread::runnable(value); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 121 | |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 122 | void weakRef(shared_ptr<PthreadThread> self) { |
Aditya Agarwal | 3f234da | 2007-04-01 01:19:57 +0000 | [diff] [blame] | 123 | assert(self.get() == this); |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 124 | self_ = weak_ptr<PthreadThread>(self); |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 125 | } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 126 | }; |
| 127 | |
Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame] | 128 | void* PthreadThread::threadMain(void* arg) { |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 129 | shared_ptr<PthreadThread> thread = *(shared_ptr<PthreadThread>*)arg; |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 130 | delete reinterpret_cast<shared_ptr<PthreadThread>*>(arg); |
| 131 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 132 | if (thread == NULL) { |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 133 | return (void*)0; |
| 134 | } |
| 135 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 136 | if (thread->state_ != starting) { |
Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame] | 137 | return (void*)0; |
| 138 | } |
| 139 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 140 | thread->state_ = starting; |
Marc Slemko | fe5ba12e | 2006-07-20 21:16:27 +0000 | [diff] [blame] | 141 | thread->runnable()->run(); |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 142 | if (thread->state_ != stopping && thread->state_ != stopped) { |
| 143 | thread->state_ = stopping; |
Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame] | 144 | } |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 145 | |
Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame] | 146 | return (void*)0; |
| 147 | } |
| 148 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 149 | /** |
| 150 | * POSIX Thread factory implementation |
| 151 | */ |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 152 | class PosixThreadFactory::Impl { |
| 153 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 154 | private: |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 155 | POLICY policy_; |
| 156 | PRIORITY priority_; |
| 157 | int stackSize_; |
| 158 | bool detached_; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 159 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 160 | /** |
| 161 | * Converts generic posix thread schedule policy enums into pthread |
| 162 | * API values. |
| 163 | */ |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 164 | static int toPthreadPolicy(POLICY policy) { |
Mark Slee | b9ff32a | 2006-11-16 01:00:24 +0000 | [diff] [blame] | 165 | switch (policy) { |
| 166 | case OTHER: |
| 167 | return SCHED_OTHER; |
| 168 | case FIFO: |
| 169 | return SCHED_FIFO; |
| 170 | case ROUND_ROBIN: |
| 171 | return SCHED_RR; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 172 | } |
Mark Slee | b9ff32a | 2006-11-16 01:00:24 +0000 | [diff] [blame] | 173 | return SCHED_OTHER; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 174 | } |
| 175 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 176 | /** |
| 177 | * Converts relative thread priorities to absolute value based on posix |
| 178 | * thread scheduler policy |
| 179 | * |
| 180 | * The idea is simply to divide up the priority range for the given policy |
| 181 | * into the correpsonding relative priority level (lowest..highest) and |
| 182 | * then pro-rate accordingly. |
| 183 | */ |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 184 | static int toPthreadPriority(POLICY policy, PRIORITY priority) { |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 185 | int pthread_policy = toPthreadPolicy(policy); |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 186 | int min_priority = sched_get_priority_min(pthread_policy); |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 187 | int max_priority = sched_get_priority_max(pthread_policy); |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 188 | int quanta = (HIGHEST - LOWEST) + 1; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 189 | float stepsperquanta = (max_priority - min_priority) / quanta; |
| 190 | |
Mark Slee | 2905078 | 2006-09-29 00:12:30 +0000 | [diff] [blame] | 191 | if (priority <= HIGHEST) { |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 192 | return (int)(min_priority + stepsperquanta * priority); |
| 193 | } else { |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 194 | // should never get here for priority increments. |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 195 | assert(false); |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 196 | return (int)(min_priority + stepsperquanta * NORMAL); |
| 197 | } |
| 198 | } |
| 199 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 200 | public: |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 201 | |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 202 | Impl(POLICY policy, PRIORITY priority, int stackSize, bool detached) : |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 203 | policy_(policy), |
| 204 | priority_(priority), |
| 205 | stackSize_(stackSize), |
| 206 | detached_(detached) {} |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 207 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 208 | /** |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 209 | * Creates a new POSIX thread to run the runnable object |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 210 | * |
| 211 | * @param runnable A runnable object |
| 212 | */ |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 213 | shared_ptr<Thread> newThread(shared_ptr<Runnable> runnable) const { |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 214 | shared_ptr<PthreadThread> result = shared_ptr<PthreadThread>(new PthreadThread(toPthreadPolicy(policy_), toPthreadPriority(policy_, priority_), stackSize_, runnable)); |
Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame] | 215 | result->weakRef(result); |
| 216 | runnable->thread(result); |
| 217 | return result; |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 218 | } |
| 219 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 220 | int stackSize() const { return stackSize_; } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 221 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 222 | void stackSize(int value) { stackSize_ = value; } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 223 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 224 | PRIORITY priority() const { return priority_; } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 225 | |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 226 | Thread::id_t currentThreadId() const { return pthread_self(); } |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 227 | |
Mark Slee | f5f2be4 | 2006-09-05 21:05:31 +0000 | [diff] [blame] | 228 | /** |
| 229 | * Sets priority. |
| 230 | * |
| 231 | * XXX |
| 232 | * Need to handle incremental priorities properly. |
| 233 | */ |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 234 | void priority(PRIORITY value) { priority_ = value; } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 235 | }; |
| 236 | |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 237 | PosixThreadFactory::PosixThreadFactory(POLICY policy, PRIORITY priority, int stackSize, bool detached) : |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 238 | impl_(new PosixThreadFactory::Impl(policy, priority, stackSize, detached)) {} |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 239 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 240 | shared_ptr<Thread> PosixThreadFactory::newThread(shared_ptr<Runnable> runnable) const { return impl_->newThread(runnable); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 241 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 242 | int PosixThreadFactory::stackSize() const { return impl_->stackSize(); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 243 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 244 | void PosixThreadFactory::stackSize(int value) { impl_->stackSize(value); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 245 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 246 | PosixThreadFactory::PRIORITY PosixThreadFactory::priority() const { return impl_->priority(); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 247 | |
Mark Slee | 2f6404d | 2006-10-10 01:37:40 +0000 | [diff] [blame] | 248 | void PosixThreadFactory::priority(PosixThreadFactory::PRIORITY value) { impl_->priority(value); } |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 249 | |
Mark Slee | 2782d6d | 2007-05-23 04:55:30 +0000 | [diff] [blame^] | 250 | Thread::id_t PosixThreadFactory::currentThreadId() const { return impl_->currentThreadId(); } |
Marc Slemko | 3a3b53b | 2007-05-22 23:59:54 +0000 | [diff] [blame] | 251 | |
Marc Slemko | 6694987 | 2006-07-15 01:52:39 +0000 | [diff] [blame] | 252 | }}} // facebook::thrift::concurrency |