On 06/10/14 21:56, Alex Peshkoff wrote:
On 06/10/14 19:21, Alex Peshkoff wrote:
On 06/09/14 18:28, vv m wrote:
Hi Alex,

I'm attaching the requested file.
Alternative (USE_FCNTL) ifdef is definitely less tested.
I will check in on linux and reply after it.


I've reproduced an error on linux.
Wait for a fix please.

Vadim, pls try attached patch.

Index: src/jrd/isc_sync.cpp
===================================================================
--- src/jrd/isc_sync.cpp	(revision 59661)
+++ src/jrd/isc_sync.cpp	(working copy)
@@ -365,8 +365,6 @@
 					rwlocks->remove(getLockId());
 					delete rwcl;
 				}
-#else /* USE_FCNTL */
-				unlock();
 #endif /* USE_FCNTL */
 			}
 			else
@@ -3105,7 +3103,7 @@
 	SharedFile* sf = SharedFile::locate(mutex);
 	if (!sf)
 	{
-		gds__log("SharedFile::locate(sem) failed");
+		gds__log("SharedFile::locate(mutex) failed");
 
 #else // USE_FILELOCKS
 
@@ -4129,7 +4127,7 @@
  *	Unmap a given file.
  *
  **************************************/
-#ifdef USE_SYS5SEMAPHORE
+#if defined(USE_SYS5SEMAPHORE)
 	// Lock init file.
 	FileLock initLock(fd_init, FileLock::OPENED);
 	if (!initLock.doLock(status_vector, FileLock::FLM_EXCLUSIVE))
@@ -4146,6 +4144,11 @@
 		SharedFile::remove(shmem_data->sh_mem_address);
 	}
 	--sharedCount;
+#elif defined(USE_FCNTL)
+	{
+		FileLock lock(shmem_data->sh_mem_handle, FileLock::OPENED);
+		lock.setLevel(FileLock::LCK_SHARED);
+	}
 #endif
 
 	munmap((char *) shmem_data->sh_mem_address, shmem_data->sh_mem_length_mapped);
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to