core/synch.c
/* Should be called to clean up after synch_with_all_threads as otherwise
 * dynamo_all_threads_synched will be left as true.
 * If resume is true, resumes the threads in the threads array.
 * Unlocks thread_initexit_lock and all_threads_synch_lock.
 * If threads != NULL, frees the threads array.
 */
Should be called to clean up after synch_with_all_threads as otherwise
dynamo_all_threads_synched will be left as true.
If resume is true, resumes the threads in the threads array.
Should be called to clean up after synch_with_all_threads as otherwise dynamo_all_threads_synched will be left as true . If resume is true resumes the threads in the threads array .
void
end_synch_with_all_threads(thread_record_t **threads, uint num_threads, bool resume)
{
    ASSERT_CURIOSITY(dynamo_all_threads_synched);
    ASSERT(OWN_MUTEX(&all_threads_synch_lock) && OWN_MUTEX(&thread_initexit_lock));
    dynamo_all_threads_synched = false;
    if (resume) {
        ASSERT(threads != NULL);
        resume_all_threads(threads, num_threads);
    }
    mutex_unlock(&thread_initexit_lock);
    mutex_unlock(&all_threads_synch_lock);
    if (threads != NULL) {
        global_heap_free(threads, num_threads*sizeof(thread_record_t*)
                         HEAPACCT(ACCT_THREAD_MGT));
    }
}
void end_synch_with_all_threads ( thread_record_t * * threads , uint num_threads , bool resume ) { ASSERT_CURIOSITY ( dynamo_all_threads_synched ) ; ASSERT ( OWN_MUTEX ( & all_threads_synch_lock ) && OWN_MUTEX ( & thread_initexit_lock ) ) ; dynamo_all_threads_synched = false ; if ( resume ) { ASSERT ( threads != NULL ) ; resume_all_threads ( threads , num_threads ) ; } mutex_unlock ( & thread_initexit_lock ) ; mutex_unlock ( & all_threads_synch_lock ) ; if ( threads != NULL ) { global_heap_free ( threads , num_threads * sizeof ( thread_record_t * ) HEAPACCT ( ACCT_THREAD_MGT ) ) ; } }
Should be called to clean up after synch_with_all_threads as otherwise
 dynamo_all_threads_synched will be left as true.
Should be called to clean up after synch_with_all_threads as otherwise dynamo_all_threads_synched will be left as true .
/* dynamo_all_threads_synched will be false if synch failed */ /* if we knew whether THREAD_SYNCH_*_CLEANED was specified we could set
     * synch_with_success to false, but it's unsafe otherwise
     */