Changeset 1568
- Timestamp:
- 06/17/08 20:22:44 (3 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/common-internal.h (modified) (2 diffs)
- cherokee/trunk/cherokee/server.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1567 r1568 1 1 2008-06-17 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/server.c (stop_threads): It must stop all the threads 4 before flushing the log files. 5 6 * cherokee/common-internal.h (CHEROKEE_THREAD_JOIN): New macro. 2 7 3 8 * cherokee/server.c (cherokee_server_print_build_info), cherokee/trunk/cherokee/common-internal.h
r1282 r1568 86 86 # define CHEROKEE_MUTEX_T(n) pthread_mutex_t n 87 87 # define CHEROKEE_RWLOCK_T(n) pthread_rwlock_t n 88 # define CHEROKEE_THREAD_JOIN(t) pthread_join(t,NULL) 88 89 89 90 # define CHEROKEE_MUTEX_LOCK(m) pthread_mutex_lock(m) … … 103 104 # define CHEROKEE_MUTEX_T(n) 104 105 # define CHEROKEE_RWLOCK_T(n) 106 # define CHEROKEE_THREAD_JOIN(t) 105 107 106 108 # define CHEROKEE_MUTEX_LOCK(m) cherokee/trunk/cherokee/server.c
r1567 r1568 1151 1151 1152 1152 static void 1153 stop_threads (cherokee_server_t *srv) 1154 { 1155 cherokee_list_t *i; 1156 1157 list_for_each (i, &srv->thread_list) { 1158 THREAD(i)->exit = true; 1159 } 1160 1161 list_for_each (i, &srv->thread_list) { 1162 CHEROKEE_THREAD_JOIN (THREAD(i)->thread); 1163 } 1164 } 1165 1166 1167 static void 1153 1168 flush_logs (cherokee_server_t *srv) 1154 1169 { 1155 1170 cherokee_list_t *i; 1156 1171 cherokee_logger_t *logger; 1157 1158 list_for_each (i, &srv->vservers) { 1159 logger = VSERVER_LOGGER(i); 1160 1161 if (logger) 1162 cherokee_logger_flush (VSERVER_LOGGER(i)); 1163 } 1164 1172 1173 /* Main virtual server 1174 */ 1165 1175 logger = VSERVER_LOGGER(srv->vserver_default); 1166 1176 if (logger) 1167 1177 cherokee_logger_flush (VSERVER_LOGGER(srv->vserver_default)); 1178 1179 /* Rest of the virtual servers 1180 */ 1181 list_for_each (i, &srv->vservers) { 1182 logger = VSERVER_LOGGER(i); 1183 if (logger) 1184 cherokee_logger_flush (VSERVER_LOGGER(i)); 1185 } 1168 1186 } 1169 1187 … … 1354 1372 #endif 1355 1373 1356 /* Wanna reinit or exit ?1357 */1358 if (likely ((srv->wanna_reinit | srv->wanna_exit) == 0))1359 return ret_eagain;1360 1361 1374 /* Wanna reinit ? 1362 1375 */ 1363 if ( srv->wanna_reinit) {1376 if (unlikely (srv->wanna_reinit)) { 1364 1377 ret = cherokee_server_reinit (srv); 1365 1378 … … 1374 1387 /* Wanna exit ? 1375 1388 */ 1376 if (srv->wanna_exit) { 1389 if (unlikely (srv->wanna_exit)) { 1390 stop_threads (srv); 1377 1391 flush_logs (srv); 1378 1392 return ret_ok;