lib/util: remove useless ../lib/util/mutex.*
authorStefan Metzmacher <metze@samba.org>
Sun, 24 Oct 2010 18:15:01 +0000 (20:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Oct 2010 23:29:46 +0000 (23:29 +0000)
Only the disabled process_thread.c registers uses the register fn,
all other functions are not used anywhere.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 26 23:29:46 UTC 2010 on sn-devel-104

lib/util/mutex.c [deleted file]
lib/util/mutex.h [deleted file]
lib/util/util.h
lib/util/wscript_build

diff --git a/lib/util/mutex.c b/lib/util/mutex.c
deleted file mode 100644 (file)
index 4d0df68..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
-   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 3 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, see <http://www.gnu.org/licenses/>.
-*/
-#include "includes.h"
-#include "mutex.h"
-
-/**
- * @file
- * @brief Mutex utility functions
- */
-        
-/* 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.
-*/
-_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;
-       }
-
-       mutex_handlers.name = name;
-       mutex_handlers.ops = *ops;
-
-       DEBUG(2,("mutex handler '%s' registered\n", name));
-       return true;
-}
-
diff --git a/lib/util/mutex.h b/lib/util/mutex.h
deleted file mode 100644 (file)
index bf84590..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _MUTEX_H_
-#define _MUTEX_H_
-/* 
-   Unix SMB/CIFS implementation.
-   Samba mutex 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 3 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, see <http://www.gnu.org/licenses/>.
-*/
-
-/** 
- * @file
- * @brief Mutex operations
- */
-
-struct mutex_ops;
-
-/* To add a new read/write lock, add it to enum rwlock_id
- */
-enum rwlock_id { RWLOCK_SMBD,          /* global smbd lock */
-
-               RWLOCK_MAX /* this MUST be kept last */
-};
-
-#define MUTEX_LOCK_BY_ID(mutex_index) smb_mutex_lock_by_id(mutex_index, #mutex_index)
-#define MUTEX_UNLOCK_BY_ID(mutex_index) smb_mutex_unlock_by_id(mutex_index, #mutex_index)
-#define MUTEX_INIT(mutex, name) smb_mutex_init(mutex, #name)
-#define MUTEX_DESTROY(mutex, name) smb_mutex_destroy(mutex, #name)
-#define MUTEX_LOCK(mutex, name) smb_mutex_lock(mutex, #name)
-#define MUTEX_UNLOCK(mutex, name) smb_mutex_unlock(mutex, #name)
-
-#define RWLOCK_INIT(rwlock, name) smb_rwlock_init(rwlock, #name)
-#define RWLOCK_DESTROY(rwlock, name) smb_rwlock_destroy(rwlock, #name)
-#define RWLOCK_LOCK_WRITE(rwlock, name) smb_rwlock_lock_write(rwlock, #name)
-#define RWLOCK_LOCK_READ(rwlock, name) smb_rwlock_lock_read(rwlock, #name)
-#define RWLOCK_UNLOCK(rwlock, name) smb_rwlock_unlock(rwlock, #name)
-
-
-
-/* this null typedef ensures we get the types right and avoids the
-   pitfalls of void* */
-typedef struct smb_mutex {
-       void *mutex;
-} smb_mutex_t;
-typedef struct {
-       void *rwlock;
-} smb_rwlock_t;
-
-/* the mutex model operations structure - contains function pointers to 
-   the model-specific implementations of each operation */
-struct mutex_ops {
-       int (*mutex_init)(smb_mutex_t *mutex, const char *name);
-       int (*mutex_lock)(smb_mutex_t *mutex, const char *name);
-       int (*mutex_unlock)(smb_mutex_t *mutex, const char *name);
-       int (*mutex_destroy)(smb_mutex_t *mutex, const char *name);
-       int (*rwlock_init)(smb_rwlock_t *rwlock, const char *name);
-       int (*rwlock_lock_write)(smb_rwlock_t *rwlock, const char *name);
-       int (*rwlock_lock_read)(smb_rwlock_t *rwlock, const char *name);
-       int (*rwlock_unlock)(smb_rwlock_t *rwlock, const char *name);
-       int (*rwlock_destroy)(smb_rwlock_t *rwlock, const char *name);
-};
-
-#endif /* endif _MUTEX_H_ */
index c407d606a9081829a9d5a2915cbc61c44a29a7d1..0073aa90513b0baa1e0a66cd0afb1e89bdd98cfe 100644 (file)
@@ -42,7 +42,6 @@ extern const char *panic_action;
 #include "../lib/util/time.h"
 #include "../lib/util/data_blob.h"
 #include "../lib/util/xfile.h"
-#include "../lib/util/mutex.h"
 #include "../lib/util/byteorder.h"
 #include "../lib/util/talloc_stack.h"
 
@@ -779,15 +778,6 @@ int ms_fnmatch(const char *pattern, const char *string, enum protocol_types prot
 int gen_fnmatch(const char *pattern, const char *string);
 #endif
 
-/* The following definitions come from lib/util/mutex.c  */
-
-
-/**
-  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);
-
 /* The following definitions come from lib/util/idtree.c  */
 
 
index e032e157d696f7afe3630090ebca0681790ddb52..799d7b1ce74d5c038d98d53f11e5370242ab2a4a 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/bin/env python
 
 bld.SAMBA_LIBRARY('samba-util',
-       source='xfile.c debug.c fault.c signal.c system.c time.c genrand.c dprintf.c util_str.c rfc1738.c substitute.c util_strlist.c util_file.c data_blob.c util.c blocking.c util_net.c fsusage.c ms_fnmatch.c mutex.c idtree.c become_daemon.c rbtree.c talloc_stack.c smb_threads.c params.c parmlist.c util_id.c select.c',
+       source='xfile.c debug.c fault.c signal.c system.c time.c genrand.c dprintf.c util_str.c rfc1738.c substitute.c util_strlist.c util_file.c data_blob.c util.c blocking.c util_net.c fsusage.c ms_fnmatch.c idtree.c become_daemon.c rbtree.c talloc_stack.c smb_threads.c params.c parmlist.c util_id.c select.c',
        public_deps='talloc LIBCRYPTO CHARSET execinfo uid_wrapper',
-       public_headers='attr.h byteorder.h data_blob.h debug.h memory.h mutex.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h',
+       public_headers='attr.h byteorder.h data_blob.h debug.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h',
        header_path= [ ('dlinklist.h util.h', '.'), ('*', 'util') ],
        local_include=False,
        vnum='0.0.1',