Skip to content

Commit

Permalink
Fixed missing macro when using pthread mutexes (fixes meetecho#2666)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed May 24, 2021
1 parent f22ab0d commit 4294f20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ typedef pthread_cond_t janus_condition;
/*! \brief Janus condition wait */
#define janus_condition_wait(a, b) pthread_cond_wait(a, b);
/*! \brief Janus condition timed wait */
#define janus_condition_timedwait(a, b, c) pthread_cond_timedwait(a, b, c);
#define janus_condition_wait_until(a, b, c) { \
const struct timespec jct = { \
.tv_sec = c / G_USEC_PER_SEC, \
.tv_nsec = (c % G_USEC_PER_SEC)*1000 \
}; \
pthread_cond_timedwait(a, b, &jct); \
}
/*! \brief Janus condition signal */
#define janus_condition_signal(a) pthread_cond_signal(a);
/*! \brief Janus condition broadcast */
Expand Down
2 changes: 1 addition & 1 deletion transports/janus_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ void janus_mqtt_client_disconnect_failure_impl(void *context, int rc) {
JANUS_LOG(LOG_ERR, "Can't disconnect from MQTT broker, return code: %d\n", rc);
janus_mqtt_context *ctx = (janus_mqtt_context *)context;
janus_mutex_lock(&ctx->disconnect.mutex);
g_cond_signal(&ctx->disconnect.cond);
janus_condition_signal(&ctx->disconnect.cond);
janus_mutex_unlock(&ctx->disconnect.mutex);
}

Expand Down

0 comments on commit 4294f20

Please sign in to comment.