> 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;
<initialize attr>
pthread_setattr_default_np(&attr)
std::thread t(...);

But this race condition prevents such usage of
pthread_setattr_default_np.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1844022

Title:
  pthread_setattr_default_np race condition with pthread_create.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1844022/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to