Find a faster way to get currently executing thread's id