From 5cdc00d947ed73eec98ff6edbce8791d67d58ebb Mon Sep 17 00:00:00 2001 From: dimitr Date: Fri, 21 Aug 2009 12:04:53 +0000 Subject: [PATCH] Corrections per Claudio's request. --- src/lock/print.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lock/print.cpp b/src/lock/print.cpp index 4edae98920..54511200a6 100644 --- a/src/lock/print.cpp +++ b/src/lock/print.cpp @@ -478,6 +478,14 @@ int CLIB_ROUTINE main( int argc, char *argv[]) exit(FINI_OK); } + if (sw_consistency) + { +#ifdef WIN_NT + ISC_mutex_init(MUTEX, shmem_data.sh_mem_name); +#endif + ISC_mutex_lock(MUTEX); + } + if (LOCK_header->lhb_length > shmem_data.sh_mem_length_mapped) { #if defined HAVE_MMAP || defined WIN_NT @@ -504,17 +512,14 @@ int CLIB_ROUTINE main( int argc, char *argv[]) exit(FINI_OK); } -#ifdef WIN_NT - ISC_mutex_init(MUTEX, shmem_data.sh_mem_name); -#endif - - ISC_mutex_lock(MUTEX); memcpy(buffer, LOCK_header, LOCK_header->lhb_length); ISC_mutex_unlock(MUTEX); LOCK_header = (lhb*)(UCHAR*) buffer; +#ifdef WIN_NT ISC_mutex_fini(MUTEX); +#endif } } else if (lock_file)