From: Niklas Hofmann Date: Wed, 13 Aug 2014 11:30:16 +0000 (+0200) Subject: Merge branch 'mesh_topology_output' into roles X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=e4e5a81447142da0fb1291b2d2119ed6981b89e5;p=meshlink Merge branch 'mesh_topology_output' into roles --- e4e5a81447142da0fb1291b2d2119ed6981b89e5 diff --cc src/meshlink.c index bf1eb92b,e84aafca..1d52724e --- a/src/meshlink.c +++ b/src/meshlink.c @@@ -785,9 -781,15 +787,15 @@@ meshlink_handle_t *meshlink_open_with_s meshlink_handle_t *mesh = xzalloc(size); mesh->confbase = xstrdup(confbase); mesh->appname = xstrdup(appname); - mesh->dclass = dclass; + mesh->devclass = devclass; if (usingname) mesh->name = xstrdup(name); - pthread_mutex_init ( &(mesh->nodes_mutex), NULL); + + // initialize mutex + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&(mesh->mesh_mutex), &attr); + mesh->threadstarted = false; event_loop_init(&mesh->loop); mesh->loop.data = mesh;