void direct_thread_terminate( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); thread->terminated = true; direct_thread_notify( thread ); }
void __D_perf_deinit() { if (counter_dump_thread) { DirectThread *thread = counter_dump_thread; direct_thread_lock( thread ); counter_dump_thread = NULL; direct_thread_notify( thread ); direct_thread_unlock( thread ); direct_thread_join( thread ); direct_thread_destroy( thread ); } //direct_perf_dump_all(); direct_hash_deinit( &counter_hash ); direct_mutex_deinit( &counter_lock ); }