-/* $Id: mmsql.c,v 1.13 2004/12/03 17:29:50 mmondor Exp $ */
+/* $Id: mmsql.c,v 1.13.2.1 2005/11/24 09:04:55 mmondor Exp $ */
/*
* Copyright (C) 2000-2004, Matthew Mondor
MMCOPYRIGHT("@(#) Copyright (c) 2000-2004\n\
\tMatthew Mondor. All rights reserved.\n");
-MMRCSID("$Id: mmsql.c,v 1.13 2004/12/03 17:29:50 mmondor Exp $");
+MMRCSID("$Id: mmsql.c,v 1.13.2.1 2005/11/24 09:04:55 mmondor Exp $");
thrfuncs.mutex_destroy = funcs->mutex_destroy;
thrfuncs.mutex_lock = funcs->mutex_lock;
thrfuncs.mutex_unlock = funcs->mutex_unlock;
- thrfuncs.thread_yield = funcs->thread_yield;
thrfuncs.thread_sleep = funcs->thread_sleep;
if ((mmsql_lock = thrfuncs.mutex_init()) != NULL)
-/* $Id: mmpop3d.c,v 1.40.2.2 2005/11/24 07:41:19 mmondor Exp $ */
+/* $Id: mmpop3d.c,v 1.40.2.3 2005/11/24 09:01:36 mmondor Exp $ */
/*
* Copyright (C) 2001-2004, Matthew Mondor
MMCOPYRIGHT("@(#) Copyright (c) 2001-2004\n\
\tMatthew Mondor. All rights reserved.\n");
-MMRCSID("$Id: mmpop3d.c,v 1.40.2.2 2005/11/24 07:41:19 mmondor Exp $");
+MMRCSID("$Id: mmpop3d.c,v 1.40.2.3 2005/11/24 09:01:36 mmondor Exp $");
thread_mutex_destroy,
thread_mutex_lock,
thread_mutex_unlock,
- NULL,
pthread_sleep
};
mmstat_t vstat;
if (hash_commands(commands, 3) && POOL_VALID(&clenv_pool) &&
POOL_VALID(&mutexes_pool) && strlist) {
+ thread_init();
fdbcinit(&gfdf, &fdbc, CONF.GBANDWIDTH_IN * 1024,
CONF.GBANDWIDTH_OUT * 1024);
mmsql_init(&mmsqlfuncs);
/* mmfd library thread support functions */
+static pthread_mutexattr_t thread_ma;
+
+static void
+thread_init(void)
+{
+ (void) pthread_mutexattr_init(&thread_ma);
+ (void) pthread_mutexattr_settype(&thread_ma, PTHREAD_MUTEX_RECURSIVE);
+}
+
+
static void *
thread_mutex_create(void)
{
pthread_mutex_unlock(&mutexes_lock);
if (mnod != NULL)
- pthread_mutex_init(&mnod->mutex, NULL);
+ pthread_mutex_init(&mnod->mutex, &thread_ma);
return ((void *)mnod);
}
-/* $Id: mmpop3d.h,v 1.16.2.1 2005/11/24 07:13:39 mmondor Exp $ */
+/* $Id: mmpop3d.h,v 1.16.2.2 2005/11/24 09:01:36 mmondor Exp $ */
/*
* Copyright (C) 2001-2004, Matthew Mondor
static int handleclient(unsigned long, int, clientlistnode *, struct iface *,
struct async_clenv *);
+static void thread_init(void);
static void *thread_mutex_create(void);
static void *thread_mutex_destroy(void *);
static void thread_mutex_lock(void *);
-/* $Id: mmsmtpd.c,v 1.74.2.2 2005/11/24 07:41:19 mmondor Exp $ */
+/* $Id: mmsmtpd.c,v 1.74.2.3 2005/11/24 09:01:36 mmondor Exp $ */
/*
* Copyright (C) 2001-2004, Matthew Mondor
MMCOPYRIGHT("@(#) Copyright (c) 2001-2004\n\
\tMatthew Mondor. All rights reserved.\n");
-MMRCSID("$Id: mmsmtpd.c,v 1.74.2.2 2005/11/24 07:41:19 mmondor Exp $");
+MMRCSID("$Id: mmsmtpd.c,v 1.74.2.3 2005/11/24 09:01:36 mmondor Exp $");
thread_mutex_destroy,
thread_mutex_lock,
thread_mutex_unlock,
- NULL,
pthread_sleep
};
mmstat_t vstat;
(!CONF.FLOOD_PROTECTION || (POOL_VALID(&hosts_pool) &&
HASHTABLE_VALID(&hosts_table) &&
hosts_table_thread != NULL))) {
+ thread_init();
fdbcinit(&gfdf, &fdbc, CONF.GBANDWIDTH_IN * 1024,
CONF.GBANDWIDTH_OUT * 1024);
mmsql_init(&mmsqlfuncs);
/* mmfd library thread support functions */
+static pthread_mutexattr_t thread_ma;
+
+static void
+thread_init(void)
+{
+ (void) pthread_mutexattr_init(&thread_ma);
+ (void) pthread_mutexattr_settype(&thread_ma, PTHREAD_MUTEX_RECURSIVE);
+}
+
+
static void *
thread_mutex_create(void)
{
pthread_mutex_unlock(&mutexes_lock);
if (mnod != NULL)
- pthread_mutex_init(&mnod->mutex, NULL);
+ pthread_mutex_init(&mnod->mutex, &thread_ma);
return ((void *)mnod);
}
-/* $Id: mmsmtpd.h,v 1.33.2.1 2005/11/24 07:13:39 mmondor Exp $ */
+/* $Id: mmsmtpd.h,v 1.33.2.2 2005/11/24 09:01:36 mmondor Exp $ */
/*
* Copyright (C) 2001-2004, Matthew Mondor
static int handleclient(unsigned long, int, clientlistnode *, struct iface *,
struct async_clenv *);
+static void thread_init(void);
static void *thread_mutex_create(void);
static void *thread_mutex_destroy(void *);
static void thread_mutex_lock(void *);