Browse Source

global_log_file_lock for windows only needs to be initialized once

bel 10 years ago
parent
commit
665dd8ac41
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -7095,7 +7095,7 @@ struct mg_context *mg_start(const struct mg_callbacks *callbacks,
     WSADATA data;
     WSAStartup(MAKEWORD(2,2), &data);
 #pragma warning(suppress: 28125)
-    InitializeCriticalSection(&global_log_file_lock);
+    if (!sTlsInit) InitializeCriticalSection(&global_log_file_lock);
 #endif /* _WIN32 && !__SYMBIAN32__ */
 
     /* Check if the config_options and the corresponding enum have compatible sizes. */