inst = (rlm_eap_t *)instance;
+#ifdef HAVE_PTHREAD_H
+ pthread_mutex_destroy(&(inst->session_mutex));
+ if (inst->handler_tree) pthread_mutex_destroy(&(inst->handler_mutex));
+#endif
+
rbtree_free(inst->session_tree);
if (inst->handler_tree) rbtree_free(inst->handler_tree);
inst->session_tree = NULL;
inst->types[i] = NULL;
}
- pthread_mutex_destroy(&(inst->session_mutex));
- if (fr_debug_flag) pthread_mutex_destroy(&(inst->handler_mutex));
-
free(inst);
return 0;
return -1;
}
+#ifdef HAVE_PTHREAD_H
if (pthread_mutex_init(&(inst->handler_mutex), NULL) < 0) {
radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno));
eap_detach(inst);
return -1;
}
+#endif
}
+#ifdef HAVE_PTHREAD_H
if (pthread_mutex_init(&(inst->session_mutex), NULL) < 0) {
radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno));
eap_detach(inst);
return -1;
}
+#endif
*instance = inst;
return 0;