2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2004 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
15 /* Portions Copyright (c) 1996 Regents of the University of Michigan.
16 * All rights reserved.
18 * Redistribution and use in source and binary forms are permitted
19 * provided that this notice is preserved and that due credit is given
20 * to the University of Michigan at Ann Arbor. The name of the University
21 * may not be used to endorse or promote products derived from this
22 * software without specific prior written permission. This software
23 * is provided ``as is'' without express or implied warranty.
26 * This work was originally developed by the University of Michigan
27 * (as part of U-MICH LDAP).
32 * replica.c - code to start up replica threads.
38 #include <ac/stdlib.h>
44 * Just invoke the Ri's process() member function, and log the start and
52 Ri *ri = (Ri *) ri_arg;
55 LDAP_LOG ( SLURPD, ARGS, "replicate: "
56 "begin replication thread for %s:%d\n",
57 ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
59 Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
60 ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
66 LDAP_LOG ( SLURPD, ARGS, "replicate: "
67 "begin replication thread for %s:%d\n",
68 ri->ri_hostname, ri->ri_port, 0 );
70 Debug( LDAP_DEBUG_ARGS, "end replication thread for %s:%d\n",
71 ri->ri_hostname, ri->ri_port, 0 );
79 * Start a detached thread for the given replica.
86 /* POSIX_THREADS or compatible */
87 if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate,
88 (void *) ri ) != 0 ) {
90 LDAP_LOG ( SLURPD, ERR, "start_replica_thread: "
91 "replica %s:%d ldap_pvt_thread_create failed\n",
92 ri->ri_hostname, ri->ri_port, 0 );
94 Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n",
95 ri->ri_hostname, ri->ri_port, 0 );