/*! \brief Publish new log sink and free the replaced. */ static void sink_publish(struct log_sink *log) { struct log_sink **current_log = &s_log; struct log_sink *old_log = rcu_xchg_pointer(current_log, log); synchronize_rcu(); sink_free(old_log); }
knot_zone_contents_t *knot_zone_switch_contents(knot_zone_t *zone, knot_zone_contents_t *new_contents) { if (zone == NULL) { return NULL; } knot_zone_contents_t *old_contents = rcu_xchg_pointer(&zone->contents, new_contents); return old_contents; }