]> granicus.if.org Git - gc/commit
Add assertions to finalize and threads support for MANUAL_VDB needs
authorIvan Maidanski <ivmai@mail.ru>
Wed, 16 May 2018 08:33:02 +0000 (11:33 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 16 May 2018 08:33:02 +0000 (11:33 +0300)
commite7ba62e0de0d0c42c3732c7b7e82a92e679648a9
tree4abca306c1d1233b31afc2a9fc2f7982ebcc9d53
parent3cf45ae841759fc3ee38704fddf56a984f861d8f
Add assertions to finalize and threads support for MANUAL_VDB needs
(code refactoring)

* finalize.c (GC_unregister_disappearing_link_inner,
GC_enqueue_all_finalizers): Remove redundant comment about held lock.
* finalize.c (GC_unregister_disappearing_link_inner,
GC_move_disappearing_link_inner, ITERATE_DL_HASHTBL_BEGIN,
GC_finalize, GC_enqueue_all_finalizers): Add assertion that the
allocation lock is held.
* pthread_support.c (first_thread): Refine comment.
* pthread_support.c (GC_new_thread): Add assertion that when the first
thread is added then GC_threads[hv] is null (thus "next" field is set
to null).
* win32_threads.c (GC_new_thread): Likewise.
* pthread_support.c (GC_delete_thread, GC_delete_gc_thread): Add
assertion that "next" field of the first thread is not modified.
* win32_threads.c (GC_delete_gc_thread_no_free, GC_delete_thread):
Likewise.
* win32_threads.c (GC_delete_thread): Use EXPECT() when checking that
p is not the first thread.
* win32_threads.c [GC_PTHREADS] (GC_pthread_start_inner): Add assertion
that the current thread is not the first one (thus "status" field of
the first thread is not modified).
finalize.c
pthread_support.c
win32_threads.c