testsuite: Fix race condition in check-libthread-db
authorAlan Hayward <alan.hayward@arm.com>
Wed, 26 Sep 2018 13:06:54 +0000 (14:06 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Thu, 27 Sep 2018 09:48:20 +0000 (10:48 +0100)
commit9fc3183f0f8ab8ec85f0e5f65bae9e18ddf545a0
tree844bce4744e06f5979038b1fb3a7115de550c0f2
parent115d0c14437a07c686e58d8c0bf30755fb379c68
testsuite: Fix race condition in check-libthread-db

It is possible for the created thread to reach the breakpoint before
the main thread has set errno to 23.

Prevent this using a pthread barrier.

* gdb.threads/check-libthread-db.c (thread_routine): Use a
pthread barrier.
(main): Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/check-libthread-db.c