src/rdkafka.c
int rd_kafka_wait_destroyed (int timeout_ms) {
	rd_ts_t timeout = rd_clock() + (timeout_ms * 1000);

	while (rd_kafka_thread_cnt() > 0 ||
	       rd_kafka_global_cnt_get() > 0) {
		if (rd_clock() >= timeout) {
			rd_kafka_set_last_error(RD_KAFKA_RESP_ERR__TIMED_OUT,
						ETIMEDOUT);
#if ENABLE_SHAREDPTR_DEBUG
                        rd_shared_ptrs_dump();
#endif
			return -1;
		}
		rd_usleep(25000, NULL); /* 25ms */
	}

	return 0;
}
/**
 * Wait for all rd_kafka_t objects to be destroyed.
 * Returns 0 if all kafka objects are now destroyed, or -1 if the
 * timeout was reached.
 */
Wait for all rd_kafka_t objects to be destroyed.
Returns 0 if all kafka objects are now destroyed, or -1 if the
timeout was reached.
Wait for all rd_kafka_t objects to be destroyed . Returns 0 if all kafka objects are now destroyed or - 1 if the timeout was reached .
int rd_kafka_wait_destroyed (int timeout_ms) {
	rd_ts_t timeout = rd_clock() + (timeout_ms * 1000);
	while (rd_kafka_thread_cnt() > 0 ||
	       rd_kafka_global_cnt_get() > 0) {
		if (rd_clock() >= timeout) {
			rd_kafka_set_last_error(RD_KAFKA_RESP_ERR__TIMED_OUT,
						ETIMEDOUT);
#if ENABLE_SHAREDPTR_DEBUG
                        rd_shared_ptrs_dump();
#endif
			return -1;
		}
		rd_usleep(25000, NULL); 
	}
	return 0;
}
int rd_kafka_wait_destroyed ( int timeout_ms ) { rd_ts_t timeout = rd_clock ( ) + ( timeout_ms * 1000 ) ; while ( rd_kafka_thread_cnt ( ) > 0 || rd_kafka_global_cnt_get ( ) > 0 ) { if ( rd_clock ( ) >= timeout ) { rd_kafka_set_last_error ( RD_KAFKA_RESP_ERR__TIMED_OUT , ETIMEDOUT ) ; #if ENABLE_SHAREDPTR_DEBUG rd_shared_ptrs_dump ( ) ; #endif return -1 ; } rd_usleep ( 25000 , NULL ) ; } return 0 ; }
Wait for all rd_kafka_t objects to be destroyed.
Wait for all rd_kafka_t objects to be destroyed .
/* 25ms */