> I assume the code in another_thread attempts to obtain the size of the current thread.
The intention is to use pthread_setattr_default_np followed by a call to std::thread contructor, because the latter doesn't allow specifying the thread attribute.
> I assume the code in another_thread attempts to obtain the size of the current thread.
The intention is to use pthread_ setattr_ default_ np followed by a call to std::thread contructor, because the latter doesn't allow specifying the thread attribute.
So, instead of:
pthread_attr_t attr;
<initialize attr>
pthread_create(..., &attr, ...)
Use:
pthread_attr_t attr; setattr_ default_ np(&attr)
<initialize attr>
pthread_
std::thread t(...);
But this race condition prevents such usage of pthread_ setattr_ default_ np.