1 /* init.c - initialize various things */
15 * read-only global variables or variables only written by the listener
16 * thread (after they are initialized) - no need to protect them with a mutex.
21 int ldap_syslog = LDAP_DEBUG_STATS;
26 int ldap_syslog_level = LOG_DEBUG;
27 char *default_referral;
29 pthread_t listener_tid;
34 * global variables that need mutex protection
37 pthread_mutex_t active_threads_mutex;
38 pthread_cond_t active_threads_cond;
41 pthread_mutex_t currenttime_mutex;
43 pthread_mutex_t new_conn_mutex;
46 pthread_mutex_t crypt_mutex;
48 pthread_mutex_t strtok_mutex;
53 pthread_mutex_t ops_mutex;
55 long num_entries_sent;
57 pthread_mutex_t num_sent_mutex;
59 * these mutexes must be used when calling the entry2str()
60 * routine since it returns a pointer to static data.
62 pthread_mutex_t entry2str_mutex;
63 pthread_mutex_t replog_mutex;
68 pthread_mutex_init( &active_threads_mutex, pthread_mutexattr_default );
69 pthread_cond_init( &active_threads_cond, pthread_condattr_default );
71 pthread_mutex_init( &new_conn_mutex, pthread_mutexattr_default );
72 pthread_mutex_init( ¤ttime_mutex, pthread_mutexattr_default );
73 pthread_mutex_init( &strtok_mutex, pthread_mutexattr_default );
74 pthread_mutex_init( &entry2str_mutex, pthread_mutexattr_default );
75 pthread_mutex_init( &replog_mutex, pthread_mutexattr_default );
76 pthread_mutex_init( &ops_mutex, pthread_mutexattr_default );
77 pthread_mutex_init( &num_sent_mutex, pthread_mutexattr_default );
79 pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default );