src/rdkafka_broker.c
int rd_kafka_brokers_wait_state_change_async (rd_kafka_t *rk,
                                              int stored_version,
                                              rd_kafka_enq_once_t *eonce) {
        int r = 1;
        mtx_lock(&rk->rk_broker_state_change_lock);

        if (stored_version != rk->rk_broker_state_change_version)
                r = 0;
        else {
                rd_kafka_enq_once_add_source(eonce, "wait broker state change");
                rd_list_add(&rk->rk_broker_state_change_waiters, eonce);
        }

        mtx_unlock(&rk->rk_broker_state_change_lock);
        return r;
}
/**
 * @brief Same as rd_kafka_brokers_wait_state_change() but will trigger
 *        the wakeup asynchronously through the provided \p eonce.
 *
 *        If the eonce was added to the wait list its reference count
 *        will have been updated, this reference is later removed by
 *        rd_kafka_broker_state_change_trigger_eonce() by calling trigger().
 *
 * @returns 1 if the \p eonce was added to the wait-broker-state-changes list,
 *          or 0 if the \p stored_version is outdated in which case the
 *          caller should redo the broker lookup.
 */
@brief Same as rd_kafka_brokers_wait_state_change() but will trigger
the wakeup asynchronously through the provided \p eonce.

If the eonce was added to the wait list its reference count
will have been updated, this reference is later removed by
rd_kafka_broker_state_change_trigger_eonce() by calling trigger().

@returns 1 if the \p eonce was added to the wait-broker-state-changes list,
or 0 if the \p stored_version is outdated in which case the
caller should redo the broker lookup.
@brief Same as rd_kafka_brokers_wait_state_change () but will trigger the wakeup asynchronously through the provided \ p eonce . If the eonce was added to the wait list its reference count will have been updated this reference is later removed by rd_kafka_broker_state_change_trigger_eonce () by calling trigger () . @returns 1 if the \ p eonce was added to the wait - broker - state - changes list or 0 if the \ p stored_version is outdated in which case the caller should redo the broker lookup .
int rd_kafka_brokers_wait_state_change_async (rd_kafka_t *rk,
                                              int stored_version,
                                              rd_kafka_enq_once_t *eonce) {
        int r = 1;
        mtx_lock(&rk->rk_broker_state_change_lock);
        if (stored_version != rk->rk_broker_state_change_version)
                r = 0;
        else {
                rd_kafka_enq_once_add_source(eonce, "wait broker state change");
                rd_list_add(&rk->rk_broker_state_change_waiters, eonce);
        }
        mtx_unlock(&rk->rk_broker_state_change_lock);
        return r;
}
int rd_kafka_brokers_wait_state_change_async ( rd_kafka_t * rk , int stored_version , rd_kafka_enq_once_t * eonce ) { int r = 1 ; mtx_lock ( & rk -> rk_broker_state_change_lock ) ; if ( stored_version != rk -> rk_broker_state_change_version ) r = 0 ; else { rd_kafka_enq_once_add_source ( eonce , " " ) ; rd_list_add ( & rk -> rk_broker_state_change_waiters , eonce ) ; } mtx_unlock ( & rk -> rk_broker_state_change_lock ) ; return r ; }
@brief Same as rd_kafka_brokers_wait_state_change() but will trigger
        the wakeup asynchronously through the provided \p eonce.
@brief Same as rd_kafka_brokers_wait_state_change () but will trigger the wakeup asynchronously through the provided \ p eonce .