meshlink_handle_t *mesh = xzalloc(sizeof *mesh);
mesh->confbase = xstrdup(confbase);
mesh->name = xstrdup(name);
+ pthread_mutex_init ( &(mesh->outpacketqueue_mutex), NULL);
event_loop_init(&mesh->loop);
mesh->loop.data = mesh;
packet_in_queue->destination=destination;
packet_in_queue->data=data;
packet_in_queue->len=len;
+ pthread_mutex_lock(&(mesh->outpacketqueue_mutex));
list_insert_tail(mesh->outpacketqueue,packet_in_queue);
+ pthread_mutex_unlock(&(mesh->outpacketqueue_mutex));
//notify event loop