mesh->name = xstrdup(name);
pthread_mutex_init ( &(mesh->outpacketqueue_mutex), NULL);
pthread_mutex_init ( &(mesh->nodes_mutex), NULL);
+ mesh->threadstarted = false;
event_loop_init(&mesh->loop);
mesh->loop.data = mesh;
return false;
}
+ mesh->threadstarted=true;
+
return true;
}
char *b64key = ecdsa_get_base64_public_key(key);
//Before doing meshlink_join make sure we are not connected to another mesh
- if ( pthread_kill(mesh->thread,0) == 0){
- printf("HELLO\n");
+ if ( mesh->threadstarted ){
goto invalid;
}