state = saved_state;
#endif
if (state == NULL) {
+#ifdef ISC_PLATFORM_USETHREADS
LOCK(&key_mutex);
+#endif
state = (geoip_state_t *) isc_mem_get(state_mctx,
sizeof(geoip_state_t));
+#ifdef ISC_PLATFORM_USETHREADS
UNLOCK(&key_mutex);
+#endif
if (state == NULL) {
return (ISC_R_NOMEMORY);
}
saved_state = state;
#endif
+#ifdef ISC_PLATFORM_USETHREADS
LOCK(&key_mutex);
+#endif
isc_mem_attach(state_mctx, &state->mctx);
+#ifdef ISC_PLATFORM_USETHREADS
UNLOCK(&key_mutex);
+#endif
}
state->db = db;