All pastes #41621 Raw Edit

Untitled

public text v1 · immutable
#41621 ·published 2006-02-14 16:49 UTC
rendered paste body
	//-- cancel the worker thread
	if (!pthread_equal(worker_cdr_thread, (pthread_t) -1)) {
		//-- lock the shared ata
		ast_mutex_lock(&worker_cdr_lock);

		//-- tell the thread to exit and signal a chance
		worker_cdr_shutdown = 1;
		ast_cond_signal(&worker_cdr_cond);

		//-- release the lock
		ast_mutex_unlock(&worker_cdr_lock);

		//-- wait for thread to exit
		pthread_join(worker_cdr_thread, NULL);
		worker_cdr_thread = (pthread_t) -1;
    }