]> granicus.if.org Git - gc/commit
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>
Mon, 18 Dec 2017 07:10:25 +0000 (10:10 +0300)
commit7de43fef17e24f4765ade994b181ae97a68f5110
tree7a823ad5132045cb132444bbc7e827cee1ebdf9d
parenta3eea4c39273bbab2482c885e073076782ce29b3
Fix data race in last_stop_count access (suspend_handler_inner)
(Cherry-pick commit 3961ab98 from 'release-7_6' branch.)

* 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]
(GC_suspend_handler_inner): Replace
me->stop_info.last_stop_count=my_stop_count 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