Skip to content
Snippets Groups Projects
Commit 4e667ab1 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fixed some potential RCU problems.

- Added missing unlock.
- Removed synchonization from dynamic array operation (not needed
  and the dynamic array will be removed anyway).
parent d7492302
Branches
Tags
No related merge requests found
......@@ -81,7 +81,7 @@ static int da_resize(da_array_t *array, da_resize_type_t type)
dbg_da("Old items pointer: %p\n", old_items);
// wait for readers to finish
synchronize_rcu();
//synchronize_rcu();
// deallocate the old array
dbg_da("RCU synchronized, deallocating old items array at address %p."
"\n", old_items);
......@@ -205,7 +205,7 @@ void da_destroy(da_array_t *array)
rcu_set_pointer(&array->items, NULL);
pthread_mutex_unlock(&array->mtx);
synchronize_rcu();
//synchronize_rcu();
free(old_items);
pthread_mutex_destroy(&array->mtx);
}
......
......@@ -866,6 +866,7 @@ static int xfr_client_start(xfrworker_t *w, knot_ns_xfr_t *data)
/* Handle errors. */
if (ret != KNOT_EOK) {
pthread_mutex_unlock(&zd->xfr_in.lock);
rcu_read_unlock();
dbg_xfr("xfr: failed to create XFR query type %d: %s\n",
data->type, knot_strerror(ret));
close(data->session);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment