[icinga-checkins] icinga.org: icinga-core/test/core: idoutils: cleanup unused, yet possible faulty threading code
git at icinga.org
git at icinga.org
Sat Aug 6 21:54:48 CEST 2011
Module: icinga-core
Branch: test/core
Commit: 546bb1b911399ecb73e7153dbd72751446bd280a
URL: https://git.icinga.org/?p=icinga-core.git;a=commit;h=546bb1b911399ecb73e7153dbd72751446bd280a
Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date: Tue Jul 26 20:38:23 2011 +0200
idoutils: cleanup unused, yet possible faulty threading code
refs #1734
---
module/idoutils/src/ido2db.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index 901beb2..077b7d4 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -1211,16 +1211,17 @@ int ido2db_handle_client_connection(int sd){
signal(SIGFPE,ido2db_child_sighandler);
/* new thread should block all signals */
- sigfillset(&newmask);
- pthread_sigmask(SIG_BLOCK,&newmask,NULL);
+ /*sigfillset(&newmask);
+ pthread_sigmask(SIG_BLOCK,&newmask,NULL);*/
/* set stack size */
- pthread_attr_init(&attr);
+ /*pthread_attr_init(&attr);
if(pthread_attr_setstacksize(&attr, IDO2DB_DEFAULT_THREAD_STACK_SIZE)!=0)
ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_client_connection() pthread_attr_setstacksize with %lu error\n", IDO2DB_DEFAULT_THREAD_STACK_SIZE);
-
+ */
/* create cleanup thread */
- if ((pthread_ret = pthread_create(&thread_pool[IDO2DB_THREAD_POOL_CLEANER], &attr, ido2db_thread_cleanup, &idi)) != 0) {
+ /*if ((pthread_ret = pthread_create(&thread_pool[IDO2DB_THREAD_POOL_CLEANER], &attr, ido2db_thread_cleanup, &idi)) != 0) {*/
+ if ((pthread_ret = pthread_create(&thread_pool[IDO2DB_THREAD_POOL_CLEANER], NULL, ido2db_thread_cleanup, &idi)) != 0) {
syslog(LOG_ERR,"Could not create thread... exiting with error '%s'\n", strerror(errno));
exit(EXIT_FAILURE);
}
@@ -1234,8 +1235,8 @@ int ido2db_handle_client_connection(int sd){
*/
/* main thread should unblock all signals */
- pthread_sigmask(SIG_UNBLOCK,&newmask,NULL);
- pthread_attr_destroy(&attr);
+ /*pthread_sigmask(SIG_UNBLOCK,&newmask,NULL);
+ pthread_attr_destroy(&attr);*/
/* initialize input data information */
ido2db_idi_init(&idi);
@@ -1255,7 +1256,7 @@ int ido2db_handle_client_connection(int sd){
ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_client_connection() idi.dbinfo.connected is '%d'\n", idi.dbinfo.connected);
/* terminate threads */
- terminate_worker_thread();
+ /*terminate_worker_thread();*/
terminate_cleanup_thread();
/* free memory allocated to dynamic buffer */
@@ -1374,7 +1375,7 @@ int ido2db_handle_client_connection(int sd){
#endif
/* terminate threads */
- terminate_worker_thread();
+ /*terminate_worker_thread();*/
terminate_cleanup_thread();
/* free memory allocated to dynamic buffer */
@@ -2817,7 +2818,7 @@ int ido2db_terminate_threads(void){
ido2db_db_deinit(&thread_idi);
/* terminate each thread on its own */
- result=terminate_worker_thread();
+ /*result=terminate_worker_thread();*/
result=terminate_cleanup_thread();
return IDO_OK;
More information about the icinga-checkins
mailing list