Fix data race in last_stop_count access (suspend_handler_inner)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 23 Nov 2017 17:15:54 +0000 (20:15 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 23 Nov 2017 17:15:54 +0000 (20:15 +0300)
commit1179203276dc068719946dc26c12b9896ebd2054
tree64ee7486d36087ba72a7affa87fe803bc2ad9731
parentce09fd5e53d75d8bc352a09bf779d56d0c7711e9
Fix data race in last_stop_count access (suspend_handler_inner)

* include/private/pthread_stop_world.h [!GC_OPENBSD_UTHREADS]
(thread_stop_info.last_stop_count): Do not define if NACL; change the
type from word to AO_t; add volatile qualifier; fix a typo in comment
("GC_stop_count").
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(update_last_stop_count): Remove.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_handler_inner): Replace update_last_stop_count() call with
AO_store_release(&me->stop_info.last_stop_count,my_stop_count).
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_all): Replace p->stop_info.last_stop_count with
AO_load(&p->stop_info.last_stop_count).
include/private/pthread_stop_world.h
pthread_stop_world.c