1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
8 * \brief Initialize global things
20 #include <gnutls/gnutls.h>
28 #include <libexslt/exslt.h>
31 static int yaz_init_flag = 0;
33 static pthread_mutex_t yaz_init_mutex = PTHREAD_MUTEX_INITIALIZER;
36 extern void yaz_log_init_globals(void);
38 void yaz_init_globals(void)
43 pthread_mutex_lock(&yaz_init_mutex);
47 yaz_log_init_globals();
52 /* most likely, GnuTLS has already initialized libgcrypt */
53 if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
55 gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
61 yaz_init_flag = 1; /* must be last, before unlocking */
64 pthread_mutex_unlock(&yaz_init_mutex);
71 * c-file-style: "Stroustrup"
72 * indent-tabs-mode: nil
74 * vim: shiftwidth=4 tabstop=8 expandtab