aboutsummaryrefslogtreecommitdiff
path: root/databases/firebird20-server
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2003-12-04 17:32:30 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2003-12-04 17:32:30 +0000
commit063e5e333b9dd40cf6becac96f3f247b72d42d32 (patch)
treefda05dacae948ee0770127623e54c0f24ccd9417 /databases/firebird20-server
parent17344ca2a6563fb481aa15395dbf1a2d96d40ef5 (diff)
downloadports-063e5e333b9dd40cf6becac96f3f247b72d42d32.tar.gz
ports-063e5e333b9dd40cf6becac96f3f247b72d42d32.zip
Notes
Diffstat (limited to 'databases/firebird20-server')
-rw-r--r--databases/firebird20-server/files/patch-src::common::classes::locks.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/databases/firebird20-server/files/patch-src::common::classes::locks.h b/databases/firebird20-server/files/patch-src::common::classes::locks.h
new file mode 100644
index 000000000000..e2948dd4bbd2
--- /dev/null
+++ b/databases/firebird20-server/files/patch-src::common::classes::locks.h
@@ -0,0 +1,49 @@
+--- src/common/classes/locks.h.orig Sun Aug 17 14:56:47 2003
++++ src/common/classes/locks.h Wed Nov 12 11:12:25 2003
+@@ -77,7 +77,7 @@
+
+ /* Process-local spinlock. Used to manage memory heaps in threaded environment. */
+ // Pthreads version of the class
+-#ifndef SOLARIS
++#if !defined(SOLARIS) && !defined(DARWIN) && !defined(FREEBSD)
+ class Spinlock {
+ private:
+ pthread_spinlock_t spinlock;
+@@ -100,6 +100,7 @@
+ }
+ };
+ #else
++#ifdef SOLARIS
+ // Who knows why Solaris 2.6 have not THIS funny spins?
+ //The next code is not comlpeted but let me compile //Konstantin
+ class Spinlock {
+@@ -123,6 +124,29 @@
+ system_call_failed::raise();
+ }
+ };
++#else // DARWIN and FREEBSD
++class Spinlock {
++private:
++ pthread_mutex_t mlock;
++public:
++ Spinlock() {
++ if (pthread_mutex_init(&mlock, 0))
++ system_call_failed::raise();
++ }
++ ~Spinlock() {
++ if (pthread_mutex_destroy(&mlock))
++ system_call_failed::raise();
++ }
++ void enter() {
++ if (pthread_mutex_lock(&mlock))
++ system_call_failed::raise();
++ }
++ void leave() {
++ if (pthread_mutex_unlock(&mlock))
++ system_call_failed::raise();
++ }
++};
++#endif
+
+ #endif
+ #endif