diff options
author | Jan Maria Matejka <mq@ucw.cz> | 2019-05-23 11:27:24 +0000 |
---|---|---|
committer | Jan Maria Matejka <mq@ucw.cz> | 2019-05-23 11:27:24 +0000 |
commit | 6479e403ef7398f48c0e1c0f1a71aa112938a357 (patch) | |
tree | 1f8d85be642df05ad5cbbaa80a9fc27b289f7ba3 /lib | |
parent | 23e3b1e6652bac4a003a7eb1e074bdaf7ebb4900 (diff) |
Filters: If somebody doesn't like _Thread_local, don't fail for now, just be a little slower.
When the parallel execution comes into place, we'll likely enforce this
C11 feature. It's much simpler and also faster than pthread_[sg]etspecific().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/birdlib.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h index 6fcc202f..9743da32 100644 --- a/lib/birdlib.h +++ b/lib/birdlib.h @@ -73,6 +73,12 @@ static inline int u64_cmp(u64 i1, u64 i2) #define UNUSED __attribute__((unused)) #define PACKED __attribute__((packed)) +#ifdef HAVE_THREAD_LOCAL +#define THREAD_LOCAL _Thread_local +#else +#define THREAD_LOCAL +#endif + /* Microsecond time */ typedef s64 btime; |