| 56 | } |
| 57 | |
| 58 | static void |
| 59 | hook_remove_locked(seq_hooks_t *to_remove) { |
| 60 | hooks_internal_t hooks_internal; |
| 61 | bool success = seq_try_load_hooks(&hooks_internal, to_remove); |
| 62 | /* We hold mu; no concurrent access. */ |
| 63 | assert(success); |
| 64 | /* Should only remove hooks that were added. */ |
| 65 | assert(hooks_internal.in_use); |
| 66 | hooks_internal.in_use = false; |
| 67 | seq_store_hooks(to_remove, &hooks_internal); |
| 68 | atomic_store_u(&nhooks, atomic_load_u(&nhooks, ATOMIC_RELAXED) - 1, |
| 69 | ATOMIC_RELAXED); |
| 70 | } |
| 71 | |
| 72 | void |
| 73 | hook_remove(tsdn_t *tsdn, void *opaque) { |