meshlink_channel_close() and meshlink_channel_shutdown() did not lock
the mutex, which could cause some race conditions.
return;
}
+ pthread_mutex_lock(&mesh->mesh_mutex);
utcp_shutdown(channel->c, direction);
+ pthread_mutex_unlock(&mesh->mesh_mutex);
}
void meshlink_channel_close(meshlink_handle_t *mesh, meshlink_channel_t *channel) {
return;
}
+ pthread_mutex_lock(&mesh->mesh_mutex);
+
utcp_close(channel->c);
/* Clean up any outstanding AIO buffers. */
free(aio);
}
+ pthread_mutex_unlock(&mesh->mesh_mutex);
+
free(channel);
}