libmultipath/checkers/tur: Fix races on tur_checker_context.thread
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 4 Oct 2016 17:41:28 +0000 (10:41 -0700)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 5 Oct 2016 06:40:58 +0000 (08:40 +0200)
commit6e2423fde75dc8b2cdb11a8a558118a1206cb8db
tree016f2a40ae38265c283f10e43486fa7c7748705d
parent873be9fef22231d0f6968fafcdc15456b54f86c2
libmultipath/checkers/tur: Fix races on tur_checker_context.thread

Avoid that pthread_cancel(ct->thread) can get called after the TUR
thread exited because this is not allowed for detached threads.
Avoid that data-race detection tools complain about reading ct->thread
without holding ct->hldr_lock.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
libmultipath/checkers/tur.c