Add lock/unlock for YAZ log writes YAZ-843
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 28 May 2015 11:51:54 +0000 (13:51 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 28 May 2015 11:51:54 +0000 (13:51 +0200)
include/yaz/log.h
src/log.c

index 57bad18..9268287 100644 (file)
@@ -220,6 +220,13 @@ YAZ_EXPORT void log_event_end(void (*func)(int level, const char *msg,
 */
 YAZ_EXPORT void yaz_log_xml_errors(const char *prefix, int log_level);
 
+/** \brief Lock for YAZ log writes
+*/
+YAZ_EXPORT void yaz_log_lock(void);
+
+/** \brief Unlock for YAZ log writes
+*/
+YAZ_EXPORT void yaz_log_unlock(void);
 YAZ_END_CDECL
 
 #endif
index bbaf4fb..8bc5ad0 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -105,12 +105,12 @@ static unsigned int next_log_bit = YLOG_LAST_BIT<<1; /* first dynamic bit */
 
 static YAZ_MUTEX log_mutex = 0;
 
-static void yaz_log_lock(void)
+void yaz_log_lock(void)
 {
     yaz_mutex_enter(log_mutex);
 }
 
-static void yaz_log_unlock(void)
+void yaz_log_unlock(void)
 {
     yaz_mutex_leave(log_mutex);
 }