1#include <common/getThreadNumber.h>
2#include <common/likely.h>
3#include <atomic>
4
5static thread_local unsigned thread_number = 0;
6static std::atomic_uint threads{0};
7
8unsigned getThreadNumber()
9{
10 if (unlikely(thread_number == 0))
11 thread_number = ++threads;
12
13 return thread_number;
14}
15