Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame^] | 1 | #ifndef AOS_LINUX_CODE_THREAD_LOCAL_H_ |
| 2 | #define AOS_LINUX_CODE_THREAD_LOCAL_H_ |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame] | 3 | |
| 4 | // The storage class to use when declaring thread-local variables. This provides |
| 5 | // a single place to change it if/when we want to switch to something standard. |
| 6 | // |
| 7 | // Example: AOS_THREAD_LOCAL void *bla; // at namespace (aka global) scope |
| 8 | // |
| 9 | // C++11 has thread_local, but it's not clear whether Clang supports that as of |
| 10 | // 12/18/12. |
| 11 | #define AOS_THREAD_LOCAL __thread |
| 12 | |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame^] | 13 | #endif // AOS_LINUX_CODE_THREAD_LOCAL_H_ |