*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 24 Nov 2005 09:04:55 +0000 (09:04 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 24 Nov 2005 09:04:55 +0000 (09:04 +0000)
mmsoftware/mmlib/mmsql.c
mmsoftware/mmmail/src/mmpop3d/mmpop3d.c
mmsoftware/mmmail/src/mmpop3d/mmpop3d.h
mmsoftware/mmmail/src/mmsmtpd/mmsmtpd.c
mmsoftware/mmmail/src/mmsmtpd/mmsmtpd.h

index f702e72..a27282c 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
@@ -69,7 +69,7 @@
 
 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 $");
 
 
 
@@ -93,7 +93,6 @@ mmsql_init(struct mmsql_threadsupport *funcs)
     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)
index 62d0543..1fbd988 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
@@ -84,7 +84,7 @@
 
 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 $");
 
 
 
@@ -262,7 +262,6 @@ main(int argc, char **argv)
        thread_mutex_destroy, 
        thread_mutex_lock,
        thread_mutex_unlock,
-       NULL,
        pthread_sleep
     };
     mmstat_t vstat;
@@ -399,6 +398,7 @@ main(int argc, char **argv)
 
     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);
@@ -1747,6 +1747,16 @@ handleclient(unsigned long id, int fd, clientlistnode *clientlnode,
 /* 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)
 {
@@ -1757,7 +1767,7 @@ 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);
 }
index 67ba1e5..5a23a7f 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
@@ -227,6 +227,7 @@ inline static bool valid_char(char);
 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 *);
index 13d8bd3..e7f17fc 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
@@ -83,7 +83,7 @@
 
 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 $");
 
 
 
@@ -344,7 +344,6 @@ main(int argc, char **argv)
        thread_mutex_destroy,
        thread_mutex_lock,
        thread_mutex_unlock,
-       NULL,
        pthread_sleep
     };
     mmstat_t vstat;
@@ -545,6 +544,7 @@ main(int argc, char **argv)
            (!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);
@@ -2658,6 +2658,16 @@ handleclient(unsigned long id, int fd, clientlistnode *clientlnode,
 /* 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)
 {
@@ -2668,7 +2678,7 @@ 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);
 }
index 6c5b747..a246ae9 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
@@ -317,6 +317,7 @@ static int do_data_queue_notify_connect(void);
 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 *);