X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fmeshlink.c;h=8ad72c15573d0f0cf4da9a25e2cbe10cd6391782;hp=9aca06779a699e17bc667b233571861f507c3b36;hb=8e4f6238558c28cd05bd580cc947d7178d2bac90;hpb=9506ae59be6efde85bc1b8dd1fe0ebbe009fb1f1 diff --git a/src/meshlink.c b/src/meshlink.c index 9aca0677..8ad72c15 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1456,12 +1456,17 @@ meshlink_handle_t *meshlink_open_ex(const meshlink_open_params_t *params) { } } - // initialize mutex + // initialize mutexes and conds pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&mesh->mutex, &attr); + pthread_mutex_init(&mesh->discovery_mutex, NULL); + pthread_cond_init(&mesh->discovery_cond, NULL); + + pthread_cond_init(&mesh->adns_cond, NULL); + mesh->threadstarted = false; event_loop_init(&mesh->loop); mesh->loop.data = mesh;