3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright (c) 1996 Regents of the University of Michigan.
10 * Redistribution and use in source and binary forms are permitted
11 * provided that this notice is preserved and that due credit is given
12 * to the University of Michigan at Ann Arbor. The name of the University
13 * may not be used to endorse or promote products derived from this
14 * software without specific prior written permission. This software
15 * is provided ``as is'' without express or implied warranty.
20 * replica.c - code to start up replica threads.
26 #include <ac/stdlib.h>
32 * Just invoke the Ri's process() member function, and log the start and
40 Ri *ri = (Ri *) ri_arg;
43 LDAP_LOG ( SLURPD, ARGS, "replicate: "
44 "begin replication thread for %s:%d\n",
45 ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
47 Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
48 ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
54 LDAP_LOG ( SLURPD, ARGS, "replicate: "
55 "begin replication thread for %s:%d\n",
56 ri->ri_hostname, ri->ri_port, 0 );
58 Debug( LDAP_DEBUG_ARGS, "end replication thread for %s:%d\n",
59 ri->ri_hostname, ri->ri_port, 0 );
67 * Start a detached thread for the given replica.
74 /* POSIX_THREADS or compatible */
75 if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate,
76 (void *) ri ) != 0 ) {
78 LDAP_LOG ( SLURPD, ERR, "start_replica_thread: "
79 "replica %s:%d ldap_pvt_thread_create failed\n",
80 ri->ri_hostname, ri->ri_port, 0 );
82 Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n",
83 ri->ri_hostname, ri->ri_port, 0 );