From dfc517b05395d925a4d7b1ce9633a849f9468e70 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 23 Feb 2006 15:52:24 +0000 Subject: r13658: More moving around of files: - Collect the generic utility functions into a lib/util/ (a la GLib is for the GNOME folks) - Remove even more files from include/ (This used to be commit ba62880f5b05c2a505dc7f54676b231197a7e707) --- source4/lib/util/mutex.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 source4/lib/util/mutex.c (limited to 'source4/lib/util/mutex.c') diff --git a/source4/lib/util/mutex.c b/source4/lib/util/mutex.c new file mode 100644 index 0000000000..480ba92cc0 --- /dev/null +++ b/source4/lib/util/mutex.c @@ -0,0 +1,52 @@ +/* + Unix SMB/CIFS implementation. + Samba mutex/lock functions + Copyright (C) Andrew Tridgell 2003 + Copyright (C) James J Myers 2003 + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#include "includes.h" +#include "mutex.h" + +/* the registered mutex handlers */ +static struct { + const char *name; + struct mutex_ops ops; +} mutex_handlers; + +/* read/write lock routines */ + + +/* + register a set of mutex/rwlock handlers. + Should only be called once in the execution of smbd. +*/ +BOOL register_mutex_handlers(const char *name, struct mutex_ops *ops) +{ + if (mutex_handlers.name != NULL) { + /* it's already registered! */ + DEBUG(2,("mutex handler '%s' already registered - failed '%s'\n", + mutex_handlers.name, name)); + return False; + } + + mutex_handlers.name = name; + mutex_handlers.ops = *ops; + + DEBUG(2,("mutex handler '%s' registered\n", name)); + return True; +} + -- cgit From aa04388943fe5d7d8c873a6ee8a4cc9af2491532 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Feb 2006 13:12:39 +0000 Subject: r13752: Add doxyfile and fix formatting of comments. Current output is available at http://samba.org/~jelmer/util-api/ (This used to be commit 90812203df151a5e62394306827c72adfe13c63c) --- source4/lib/util/mutex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/lib/util/mutex.c') diff --git a/source4/lib/util/mutex.c b/source4/lib/util/mutex.c index 480ba92cc0..79c281ff0c 100644 --- a/source4/lib/util/mutex.c +++ b/source4/lib/util/mutex.c @@ -20,6 +20,11 @@ */ #include "includes.h" #include "mutex.h" + +/** + * @file + * @brief Mutex utility functions + */ /* the registered mutex handlers */ static struct { @@ -30,7 +35,7 @@ static struct { /* read/write lock routines */ -/* +/** register a set of mutex/rwlock handlers. Should only be called once in the execution of smbd. */ -- cgit From af30a32b6924b0f2b701186e435defbca2ebd1aa Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 5 Mar 2006 17:15:19 +0000 Subject: r13840: Mark some functions as public. (This used to be commit 9a188eb1f48a50d92a67a4fc2b3899b90074059a) --- source4/lib/util/mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/util/mutex.c') diff --git a/source4/lib/util/mutex.c b/source4/lib/util/mutex.c index 79c281ff0c..3b64f4929b 100644 --- a/source4/lib/util/mutex.c +++ b/source4/lib/util/mutex.c @@ -39,7 +39,7 @@ static struct { register a set of mutex/rwlock handlers. Should only be called once in the execution of smbd. */ -BOOL register_mutex_handlers(const char *name, struct mutex_ops *ops) +_PUBLIC_ BOOL register_mutex_handlers(const char *name, struct mutex_ops *ops) { if (mutex_handlers.name != NULL) { /* it's already registered! */ -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/lib/util/mutex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/lib/util/mutex.c') diff --git a/source4/lib/util/mutex.c b/source4/lib/util/mutex.c index 3b64f4929b..ec7e9dfd2e 100644 --- a/source4/lib/util/mutex.c +++ b/source4/lib/util/mutex.c @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" #include "mutex.h" -- cgit From 4fb038b0b8e7a4bb69ac0d9022684eeaca8a491a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 27 Aug 2007 17:21:16 +0000 Subject: r24710: Use standard boolean type for easier use by external users. (This used to be commit 99f4124137d4a61216e8189f26d4da32882c0f4a) --- source4/lib/util/mutex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/util/mutex.c') diff --git a/source4/lib/util/mutex.c b/source4/lib/util/mutex.c index ec7e9dfd2e..4d0df68eed 100644 --- a/source4/lib/util/mutex.c +++ b/source4/lib/util/mutex.c @@ -38,19 +38,19 @@ static struct { register a set of mutex/rwlock handlers. Should only be called once in the execution of smbd. */ -_PUBLIC_ BOOL register_mutex_handlers(const char *name, struct mutex_ops *ops) +_PUBLIC_ bool register_mutex_handlers(const char *name, struct mutex_ops *ops) { if (mutex_handlers.name != NULL) { /* it's already registered! */ DEBUG(2,("mutex handler '%s' already registered - failed '%s'\n", mutex_handlers.name, name)); - return False; + return false; } mutex_handlers.name = name; mutex_handlers.ops = *ops; DEBUG(2,("mutex handler '%s' registered\n", name)); - return True; + return true; } -- cgit