| 81 | } |
| 82 | |
| 83 | static void update_min_max_atomic(struct hdr_histogram* h, int64_t value) |
| 84 | { |
| 85 | int64_t current_min_value; |
| 86 | int64_t current_max_value; |
| 87 | do |
| 88 | { |
| 89 | current_min_value = hdr_atomic_load_64(&h->min_value); |
| 90 | |
| 91 | if (0 == value || current_min_value <= value) |
| 92 | { |
| 93 | break; |
| 94 | } |
| 95 | } |
| 96 | while (!hdr_atomic_compare_exchange_64(&h->min_value, ¤t_min_value, value)); |
| 97 | |
| 98 | do |
| 99 | { |
| 100 | current_max_value = hdr_atomic_load_64(&h->max_value); |
| 101 | |
| 102 | if (value <= current_max_value) |
| 103 | { |
| 104 | break; |
| 105 | } |
| 106 | } |
| 107 | while (!hdr_atomic_compare_exchange_64(&h->max_value, ¤t_max_value, value)); |
| 108 | } |
| 109 | |
| 110 | |
| 111 | /* ## ## ######## #### ## #### ######## ## ## */ |
no test coverage detected