Add a configure check for strtok() and add locks around its use
[privoxy.git] / jcc.c
diff --git a/jcc.c b/jcc.c
index 1457206..3efa390 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.370 2011/10/23 11:23:35 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.371 2011/10/23 11:24:33 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -198,6 +198,10 @@ privoxy_mutex_t localtime_mutex;
 privoxy_mutex_t rand_mutex;
 #endif /* ndef HAVE_RANDOM */
 
+#ifdef HAVE_STRTOK
+privoxy_mutex_t strtok_mutex;
+#endif /* def HAVE_STRTOK */
+
 #endif /* def MUTEX_LOCKS_AVAILABLE */
 
 #if defined(unix)
@@ -2847,6 +2851,10 @@ static void initialize_mutexes(void)
 #ifndef HAVE_RANDOM
    privoxy_mutex_init(&rand_mutex);
 #endif /* ndef HAVE_RANDOM */
+
+#ifdef HAVE_STRTOK
+   privoxy_mutex_init(&strtok_mutex);
+#endif /* def HAVE_STRTOK */
 #endif /* def MUTEX_LOCKS_AVAILABLE */
 }