| 1148 | } |
| 1149 | |
| 1150 | static void |
| 1151 | load_global_configuration(TSCont contp) |
| 1152 | { |
| 1153 | const char *path = static_cast<const char *>(TSContDataGet(contp)); |
| 1154 | Configuration *newconfig = Configuration::Parse(path); |
| 1155 | Configuration *oldconfig = __sync_lock_test_and_set(&cur_config, newconfig); |
| 1156 | |
| 1157 | debug("config swapped, old config %p", oldconfig); |
| 1158 | |
| 1159 | // need a mutex for when there are multiple reloads going on |
| 1160 | TSMutexLock(compress_config_mutex); |
| 1161 | if (prev_config) { |
| 1162 | debug("deleting previous configuration container, %p", prev_config); |
| 1163 | delete prev_config; |
| 1164 | } |
| 1165 | prev_config = oldconfig; |
| 1166 | TSMutexUnlock(compress_config_mutex); |
| 1167 | } |
| 1168 | |
| 1169 | static int |
| 1170 | management_update(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */) |
no test coverage detected