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