mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
rename mutex_t to smb_mutex_t to prevent name collision
This commit is contained in:
parent
c770603ac6
commit
d32f149592
@ -57,7 +57,7 @@ enum rwlock_id { RWLOCK_SMBD, /* global smbd lock */
|
||||
pitfalls of void* */
|
||||
typedef struct {
|
||||
void *mutex;
|
||||
} mutex_t;
|
||||
} smb_mutex_t;
|
||||
typedef struct {
|
||||
void *rwlock;
|
||||
} rwlock_t;
|
||||
@ -65,10 +65,10 @@ typedef struct {
|
||||
/* the mutex model operations structure - contains function pointers to
|
||||
the model-specific implementations of each operation */
|
||||
struct mutex_ops {
|
||||
int (*mutex_init)(mutex_t *mutex, const char *name);
|
||||
int (*mutex_lock)(mutex_t *mutex, const char *name);
|
||||
int (*mutex_unlock)(mutex_t *mutex, const char *name);
|
||||
int (*mutex_destroy)(mutex_t *mutex, const char *name);
|
||||
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)(rwlock_t *rwlock, const char *name);
|
||||
int (*rwlock_lock_write)(rwlock_t *rwlock, const char *name);
|
||||
int (*rwlock_lock_read)(rwlock_t *rwlock, const char *name);
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "includes.h"
|
||||
|
||||
static mutex_t mutex_list[MUTEX_MAX];
|
||||
static smb_mutex_t mutex_list[MUTEX_MAX];
|
||||
|
||||
/* the registered mutex handlers */
|
||||
static struct {
|
||||
@ -38,7 +38,7 @@ int mutex_unlock_by_id(enum mutex_id id, const char *name)
|
||||
return mutex_unlock(&mutex_list[id], name);
|
||||
}
|
||||
|
||||
int mutex_init(mutex_t *mutex, const char *name)
|
||||
int mutex_init(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
if (mutex_handlers.ops.mutex_init) {
|
||||
return mutex_handlers.ops.mutex_init(mutex, name);
|
||||
@ -46,7 +46,7 @@ int mutex_init(mutex_t *mutex, const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mutex_destroy(mutex_t *mutex, const char *name)
|
||||
int mutex_destroy(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
if (mutex_handlers.ops.mutex_destroy) {
|
||||
return mutex_handlers.ops.mutex_destroy(mutex, name);
|
||||
@ -54,7 +54,7 @@ int mutex_destroy(mutex_t *mutex, const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mutex_lock(mutex_t *mutex, const char *name)
|
||||
int mutex_lock(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
if (mutex_handlers.ops.mutex_lock) {
|
||||
return mutex_handlers.ops.mutex_lock(mutex, name);
|
||||
@ -62,7 +62,7 @@ int mutex_lock(mutex_t *mutex, const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mutex_unlock(mutex_t *mutex, const char *name)
|
||||
int mutex_unlock(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
if (mutex_handlers.ops.mutex_unlock) {
|
||||
return mutex_handlers.ops.mutex_unlock(mutex, name);
|
||||
|
@ -96,7 +96,7 @@ static void terminate_connection(struct server_context *server, const char *reas
|
||||
/*
|
||||
mutex init function for thread model
|
||||
*/
|
||||
static int thread_mutex_init(mutex_t *mutex, const char *name)
|
||||
static int thread_mutex_init(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
|
||||
mutex->mutex = memdup(&m, sizeof(m));
|
||||
@ -110,7 +110,7 @@ static int thread_mutex_init(mutex_t *mutex, const char *name)
|
||||
/*
|
||||
mutex destroy function for thread model
|
||||
*/
|
||||
static int thread_mutex_destroy(mutex_t *mutex, const char *name)
|
||||
static int thread_mutex_destroy(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
return pthread_mutex_destroy((pthread_mutex_t *)mutex->mutex);
|
||||
}
|
||||
@ -131,7 +131,7 @@ static double mutex_end_timer(struct timeval tp1)
|
||||
/*
|
||||
mutex lock function for thread model
|
||||
*/
|
||||
static int thread_mutex_lock(mutex_t *mutexP, const char *name)
|
||||
static int thread_mutex_lock(smb_mutex_t *mutexP, const char *name)
|
||||
{
|
||||
pthread_mutex_t *mutex = (pthread_mutex_t *)mutexP->mutex;
|
||||
int rc;
|
||||
@ -160,7 +160,7 @@ static int thread_mutex_lock(mutex_t *mutexP, const char *name)
|
||||
/*
|
||||
mutex unlock for thread model
|
||||
*/
|
||||
static int thread_mutex_unlock(mutex_t *mutex, const char *name)
|
||||
static int thread_mutex_unlock(smb_mutex_t *mutex, const char *name)
|
||||
{
|
||||
return pthread_mutex_unlock((pthread_mutex_t *)mutex->mutex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user