summaryrefslogtreecommitdiff
path: root/mysys/my_atomic.c
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-11-17 17:11:32 -0700
committerMarc Alff <marc.alff@sun.com>2009-11-17 17:11:32 -0700
commit382ae222902919f37ae749acada48ee05e3704e6 (patch)
tree4b3f59fa13833492f961ebb9857d1149467a9db8 /mysys/my_atomic.c
parent7d59878096611f3869aef17fe2658d6beffd7823 (diff)
downloadmariadb-git-382ae222902919f37ae749acada48ee05e3704e6.tar.gz
WL#2595 kernel-independent atomic operations
Backport from 6.0.14 to 5.6.0 Original code from Sergei Golubchik
Diffstat (limited to 'mysys/my_atomic.c')
-rw-r--r--mysys/my_atomic.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/mysys/my_atomic.c b/mysys/my_atomic.c
index aa04d55f624..6bc76f0de3c 100644
--- a/mysys/my_atomic.c
+++ b/mysys/my_atomic.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (C) 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
-#include <my_pthread.h>
+#include <my_sys.h>
#ifndef HAVE_INLINE
/* the following will cause all inline functions to be instantiated */
@@ -43,3 +43,32 @@ int my_atomic_initialize()
#endif
}
+#ifdef SAFE_MUTEX
+#undef pthread_mutex_init
+#undef pthread_mutex_destroy
+#undef pthread_mutex_lock
+#undef pthread_mutex_unlock
+
+void plain_pthread_mutex_init(safe_mutex_t *m)
+{
+ pthread_mutex_init(& m->mutex, NULL);
+}
+
+void plain_pthread_mutex_destroy(safe_mutex_t *m)
+{
+ pthread_mutex_destroy(& m->mutex);
+}
+
+void plain_pthread_mutex_lock(safe_mutex_t *m)
+{
+ pthread_mutex_lock(& m->mutex);
+}
+
+void plain_pthread_mutex_unlock(safe_mutex_t *m)
+{
+ pthread_mutex_unlock(& m->mutex);
+}
+
+#endif
+
+