#include <sys/types.h>
#include <sys/stat.h>
#include <yaz/log.h>
+#include <yaz/nmem.h>
-#include "pazpar2.h"
+#include "ppmutex.h"
+#include "session.h"
#include "host.h"
+#include "pazpar2_config.h"
#include "settings.h"
#include "http.h"
#include "zeerex.h"
xfree(host);
return 0;
}
- yaz_mutex_create(&host->mutex);
+ pazpar2_mutex_create(&host->mutex, "host");
return host;
}
database_hosts_t p = xmalloc(sizeof(*p));
p->hosts = 0;
p->mutex = 0;
- yaz_mutex_create(&p->mutex);
+ pazpar2_mutex_create(&p->mutex, "database");
return p;
}
+void database_hosts_destroy(database_hosts_t *pp)
+{
+ if (*pp)
+ {
+ struct host *p = (*pp)->hosts;
+ while (p)
+ {
+ struct host *p_next = p->next;
+ yaz_mutex_destroy(&p->mutex);
+ xfree(p->ipport);
+ xfree(p->hostport);
+ xfree(p);
+ p = p_next;
+ }
+ yaz_mutex_destroy(&(*pp)->mutex);
+ xfree(*pp);
+ }
+}
+
/*
* Local variables:
* c-basic-offset: 4