|
From: <ale...@us...> - 2012-03-06 13:28:13
|
Revision: 54103
http://firebird.svn.sourceforge.net/firebird/?rev=54103&view=rev
Author: alexpeshkoff
Date: 2012-03-06 13:28:02 +0000 (Tue, 06 Mar 2012)
Log Message:
-----------
Fixed CORE-3682: Firebird 2.5.1 OSX Lion hangs on attaching to second database
Modified Paths:
--------------
firebird/branches/B2_5_Release/builds/make.new/config/install-sh
firebird/branches/B2_5_Release/builds/posix/Makefile.in.client.util
firebird/branches/B2_5_Release/src/jrd/isc.h
firebird/branches/B2_5_Release/src/jrd/isc_sync.cpp
firebird/branches/B2_5_Release/src/lock/print.cpp
Modified: firebird/branches/B2_5_Release/builds/make.new/config/install-sh
===================================================================
--- firebird/branches/B2_5_Release/builds/make.new/config/install-sh 2012-03-06 13:25:20 UTC (rev 54102)
+++ firebird/branches/B2_5_Release/builds/make.new/config/install-sh 2012-03-06 13:28:02 UTC (rev 54103)
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -515,6 +515,5 @@
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
+# time-stamp-end: "$"
# End:
Modified: firebird/branches/B2_5_Release/builds/posix/Makefile.in.client.util
===================================================================
--- firebird/branches/B2_5_Release/builds/posix/Makefile.in.client.util 2012-03-06 13:25:20 UTC (rev 54102)
+++ firebird/branches/B2_5_Release/builds/posix/Makefile.in.client.util 2012-03-06 13:28:02 UTC (rev 54103)
@@ -30,6 +30,7 @@
#
ROOT=..
ObjModuleType=std
+CPPFLAGS+= -DFB_SUPER_UTIL
include $(ROOT)/gen/make.defaults
include $(ROOT)/gen/make.platform
Modified: firebird/branches/B2_5_Release/src/jrd/isc.h
===================================================================
--- firebird/branches/B2_5_Release/src/jrd/isc.h 2012-03-06 13:25:20 UTC (rev 54102)
+++ firebird/branches/B2_5_Release/src/jrd/isc.h 2012-03-06 13:28:02 UTC (rev 54103)
@@ -33,16 +33,19 @@
// Firebird platform-specific synchronization data structures
-#if defined(DARWIN) || defined(FREEBSD)
+#if defined(DARWIN) || defined(FREEBSD) || defined(LINUX)
#define USE_SYS5SEMAPHORE
#endif
+#if defined(USE_SYS5SEMAPHORE) && (defined(SUPERSERVER) || defined(FB_SUPER_UTIL))
+#undef USE_SYS5SEMAPHORE
+#define USE_LOCAL_MUTEXES // this kills -c switch in fb_lock_print, but makes all the rest happy
+#endif
+
#ifdef LINUX
-
// This hack fixes CORE-2896 - embedded connections fail on linux.
// Looks like a lot of linux kernels are buggy when working with PRIO_INHERIT mutexes.
#undef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
-
#endif //LINUX
#ifdef UNIX
Modified: firebird/branches/B2_5_Release/src/jrd/isc_sync.cpp
===================================================================
--- firebird/branches/B2_5_Release/src/jrd/isc_sync.cpp 2012-03-06 13:25:20 UTC (rev 54102)
+++ firebird/branches/B2_5_Release/src/jrd/isc_sync.cpp 2012-03-06 13:28:02 UTC (rev 54103)
@@ -1290,12 +1290,14 @@
PTHREAD_ERROR(pthread_mutexattr_init(&mattr));
PTHREAD_ERROR(pthread_condattr_init(&cattr));
+#ifndef USE_LOCAL_MUTEXES
#ifdef PTHREAD_PROCESS_SHARED
PTHREAD_ERROR(pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED));
PTHREAD_ERROR(pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED));
#else
#error Your system must support PTHREAD_PROCESS_SHARED to use firebird.
#endif
+#endif
PTHREAD_ERROR(pthread_mutex_init(event->event_mutex, &mattr));
PTHREAD_ERROR(pthread_cond_init(event->event_cond, &cattr));
PTHREAD_ERROR(pthread_mutexattr_destroy(&mattr));
@@ -2750,6 +2752,10 @@
#define BUGGY_LINUX_MUTEX
#endif
+#ifdef USE_LOCAL_MUTEXES
+#undef BUGGY_LINUX_MUTEX
+#endif
+
#ifdef BUGGY_LINUX_MUTEX
static volatile bool staticBugFlag = false;
#endif
@@ -2782,11 +2788,12 @@
pthread_mutexattr_t mattr;
PTHREAD_ERRNO(pthread_mutexattr_init(&mattr));
+#ifndef USE_LOCAL_MUTEXES
#ifdef PTHREAD_PROCESS_SHARED
PTHREAD_ERRNO(pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED));
#else
#error Your system must support PTHREAD_PROCESS_SHARED to use Firebird.
-#endif
+#endif //PTHREAD_PROCESS_SHARED
#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
#ifdef BUGGY_LINUX_MUTEX
@@ -2802,7 +2809,7 @@
#ifdef BUGGY_LINUX_MUTEX
}
#endif
-#endif
+#endif //HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
#ifdef USE_ROBUST_MUTEX
#ifdef BUGGY_LINUX_MUTEX
@@ -2813,7 +2820,8 @@
#ifdef BUGGY_LINUX_MUTEX
}
#endif
-#endif
+#endif //USE_ROBUST_MUTEX
+#endif //USE_LOCAL_MUTEXES
memset(mutex->mtx_mutex, 0, sizeof(pthread_mutex_t));
//int state = LOG_PTHREAD_ERROR(pthread_mutex_init(mutex->mtx_mutex, &mattr));
Modified: firebird/branches/B2_5_Release/src/lock/print.cpp
===================================================================
--- firebird/branches/B2_5_Release/src/lock/print.cpp 2012-03-06 13:25:20 UTC (rev 54102)
+++ firebird/branches/B2_5_Release/src/lock/print.cpp 2012-03-06 13:28:02 UTC (rev 54103)
@@ -251,6 +251,7 @@
FPRINTF(outfile, "%s", valid_switches);
exit(FINI_OK);
}
+
SCHAR c;
while (c = *p++)
switch (c)
@@ -261,6 +262,10 @@
break;
case 'c':
+#ifdef USE_LOCAL_MUTEXES
+ FPRINTF(outfile, "%s\n", "Sorry, on this platform -c switch is not supported for SuperServer");
+ exit(FINI_OK);
+#endif
sw_consistency = true;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|