explicit initialization of a mutex
- redis-cli now explicitly initializes "used_memory_mutex" defined and used in zmalloc.c Fixes #3
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
#include "Win32_Interop/Win32_Portability.h"
|
||||
#include "Win32_Interop/win32_types.h"
|
||||
#include "Win32_Interop/Win32_Time.h"
|
||||
#include "Win32_Interop/win32fixes.h"
|
||||
#include "Win32_Interop/Win32_PThread.h"
|
||||
#endif
|
||||
|
||||
#include "fmacros.h"
|
||||
@@ -155,6 +157,10 @@ char *redisGitSHA1(void);
|
||||
char *redisGitDirty(void);
|
||||
static int cliConnect(int force);
|
||||
|
||||
#ifdef _WIN32
|
||||
extern pthread_mutex_t used_memory_mutex;
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Utility functions
|
||||
*--------------------------------------------------------------------------- */
|
||||
@@ -2641,6 +2647,10 @@ static void intrinsicLatencyMode(void) {
|
||||
int main(int argc, char **argv) {
|
||||
int firstarg;
|
||||
|
||||
#ifdef _WIN32
|
||||
pthread_mutex_init(&used_memory_mutex, NULL);
|
||||
#endif
|
||||
|
||||
config.hostip = sdsnew("127.0.0.1");
|
||||
config.hostport = 6379;
|
||||
config.hostsocket = NULL;
|
||||
|
||||
Reference in New Issue
Block a user