]> git.sur5r.net Git - openldap/commitdiff
Changes prompted by Terry's patches
authorKurt Zeilenga <kurt@openldap.org>
Tue, 18 Aug 1998 00:41:35 +0000 (00:41 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 18 Aug 1998 00:41:35 +0000 (00:41 +0000)
servers/slapd/connection.c
servers/slapd/main.c
servers/slurpd/replica.c

index 275e644af82623a869cd020d59c12874d6a7b79b..b4f10bbe9b84c0530a7e11a7d1ccb5a839ce9988 100644 (file)
@@ -203,11 +203,11 @@ connection_activity(
 
        pthread_attr_init( &attr );
        pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-#ifdef PTHREAD_MUTEX_INITIALIZER
-       /*
+#ifndef THREAD_MIT_PTHREADS
+       /* POSIX_THREADS or compatible
         * This is a draft 10 or standard pthreads implementation
         */
-       if ( pthread_create( &arg->co_op->o_tid, attr,
+       if ( pthread_create( &arg->co_op->o_tid, &attr,
            (void *) connection_operation, (void *) arg ) != 0 ) {
                Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
        } else {
@@ -215,11 +215,11 @@ connection_activity(
                active_threads++;
                pthread_mutex_unlock( &active_threads_mutex );
        }
-#else  /* !PTHREAD_MUTEX_INITIALIZER*/
+#else  /* !THREAD_MIT_PTHREAD */
        /*
         * This is a draft 4 or earlier pthreads implementation
         */
-       if ( pthread_create( &arg->co_op->o_tid, &attr,
+       if ( pthread_create( &arg->co_op->o_tid, attr,
            (void *) connection_operation, (void *) arg ) != 0 ) {
                Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
        } else {
@@ -227,6 +227,6 @@ connection_activity(
                active_threads++;
                pthread_mutex_unlock( &active_threads_mutex );
        }
-#endif /* !PTHREAD_MUTEX_INITIALIZER*/
+#endif /* !THREAD_MIT_PTHREAD */
        pthread_attr_destroy( &attr );
 }
index b2777d544b205032f5caa7f6bbb6c9a628e2d81a..152973310fc5c76934de257c7daab7a09b113bdc 100644 (file)
@@ -185,27 +185,27 @@ main( argc, argv )
                pthread_attr_init( &attr );
                pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-#ifdef PTHREAD_MUTEX_INITIALIZER
-               /*
+#ifndef THREAD_MIT_PTHREADS
+               /* POSIX_THREADS or compatible
                 * This is a draft 10 or standard pthreads implementation
                 */
-               if ( pthread_create( &listener_tid, attr, (void *) slapd_daemon,
+               if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
                    (void *) port ) != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                            "listener pthread_create failed\n", 0, 0, 0 );
                        exit( 1 );
                }
-#else  /* !PTHREAD_MUTEX_INITIALIZER */
+#else  /* !THREAD_MIT_PTHREADS */
                /*
                 * This is a draft 4 or earlier pthreads implementation
                 */
-               if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon,
+               if ( pthread_create( &listener_tid, attr, (void *) slapd_daemon,
                    (void *) port ) != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                            "listener pthread_create failed\n", 0, 0, 0 );
                        exit( 1 );
                }
-#endif /* !PTHREAD_MUTEX_INITIALIZER */
+#endif /* !THREAD_MIT_PTHREADS */
                pthread_attr_destroy( &attr );
                pthread_join( listener_tid, (void *) &status );
                pthread_exit( 0 );
index 59c2f726729af06df06766c9a4600bec7254a293..596d14d383e18af4e87f561a58c3a7416c3ea214 100644 (file)
@@ -59,29 +59,29 @@ start_replica_thread(
     pthread_attr_init( &attr );
     pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-#ifdef PTHREAD_MUTEX_INITIALIZER
-    /*
+#ifndef THREAD_MIT_PTHREADS
+    /* POSIX_THREADS or compatible
      * This is a draft 10 or standard pthreads implementation
      */
-    if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate,
+    if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate,
            (void *) ri ) != 0 ) {
        Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
                ri->ri_hostname, ri->ri_port, 0 );
        pthread_attr_destroy( &attr );
        return -1;
     }
-#else  /* !PTHREAD_MUTEX_INITIALIZER */
+#else  /* !THREAD_MIT_PTHREADS */
     /*
      * This is a draft 4 or earlier pthreads implementation
      */
-    if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate,
+    if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate,
            (void *) ri ) != 0 ) {
        Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n",
                ri->ri_hostname, ri->ri_port, 0 );
        pthread_attr_destroy( &attr );
        return -1;
     }
-#endif /* !PTHREAD_MUTEX_INITIALIZER */
+#endif /* !THREAD_MIT_PTHREADS */
     pthread_attr_destroy( &attr );
     return 0;
 }