diff --git a/exec/amf.c b/exec/amf.c index f3767858..3bc3e05c 100644 --- a/exec/amf.c +++ b/exec/amf.c @@ -86,7 +86,6 @@ #include "../include/list.h" #include "../lcr/lcr_comp.h" #include "totempg.h" -#include "aispoll.h" #include "mempool.h" #include "util.h" #include "amf.h" diff --git a/exec/amf.h b/exec/amf.h index 29be214a..ee2bf1d6 100644 --- a/exec/amf.h +++ b/exec/amf.h @@ -43,8 +43,8 @@ #include "../include/saAmf.h" #include "../include/list.h" #include "../include/ipc_gen.h" -#include "aispoll.h" #include "objdb.h" +#include "timer.h" enum escalation_levels { ESCALATION_LEVEL_NO_ESCALATION = 1, /* execute component restart */ @@ -78,7 +78,7 @@ struct amf_cluster { struct amf_application *application_head; /* Implementation */ - poll_timer_handle timeout_handle; + openais_timer_handle timeout_handle; }; struct amf_node { @@ -267,8 +267,8 @@ struct amf_healthcheck { int active; SaAmfHealthcheckInvocationT invocationType; SaAmfRecommendedRecoveryT recommendedRecovery; - poll_timer_handle timer_handle_duration; - poll_timer_handle timer_handle_period; + openais_timer_handle timer_handle_duration; + openais_timer_handle timer_handle_period; }; struct amf_si { diff --git a/exec/amfcluster.c b/exec/amfcluster.c index ab0735e9..594cb1c0 100644 --- a/exec/amfcluster.c +++ b/exec/amfcluster.c @@ -71,7 +71,6 @@ #include "print.h" #include "amf.h" -#include "aispoll.h" #include "util.h" #include "main.h" @@ -99,7 +98,7 @@ static void timer_function_cluster_startup_tmo (void *_cluster) } /* wait a while before assigning workload */ - poll_timer_add (aisexec_poll_handle, + openais_timer_add ( cluster->saAmfClusterStartupTimeout, cluster, timer_function_cluster_assign_workload_tmo, @@ -109,7 +108,7 @@ static void timer_function_cluster_startup_tmo (void *_cluster) void amf_cluster_start (struct amf_cluster *cluster) { /* wait a while before starting applications */ - poll_timer_add (aisexec_poll_handle, + openais_timer_add ( cluster->saAmfClusterStartupTimeout, cluster, timer_function_cluster_startup_tmo, diff --git a/exec/amfcomp.c b/exec/amfcomp.c index 5f33c760..537695c3 100644 --- a/exec/amfcomp.c +++ b/exec/amfcomp.c @@ -135,7 +135,6 @@ #include "../include/ipc_gen.h" #include "../include/ipc_amf.h" #include "totempg.h" -#include "aispoll.h" #include "main.h" #include "ipc.h" #include "service.h" @@ -832,11 +831,9 @@ static void healthcheck_deactivate ( dprintf ("deactivating healthcheck for component %s\n", getSaNameT (&healthcheck_active->comp->name)); - poll_timer_delete (aisexec_poll_handle, - healthcheck_active->timer_handle_period); + openais_timer_delete (healthcheck_active->timer_handle_period); - poll_timer_delete (aisexec_poll_handle, - healthcheck_active->timer_handle_duration); + openais_timer_delete (healthcheck_active->timer_handle_duration); invocation_destroy_by_data ((void *)healthcheck_active); healthcheck_active->active = 0; @@ -855,7 +852,7 @@ static void timer_function_healthcheck_next_fn (void *_healthcheck) lib_healthcheck_request (healthcheck); /* start duration timer for response */ - poll_timer_add (aisexec_poll_handle, + openais_timer_add ( healthcheck->saAmfHealthcheckMaxDuration, (void *)healthcheck, timer_function_healthcheck_tmo, @@ -1148,14 +1145,14 @@ SaAisErrorT amf_comp_healthcheck_start ( if (invocationType == SA_AMF_HEALTHCHECK_AMF_INVOKED) { /* start timer to execute first healthcheck request */ - poll_timer_add (aisexec_poll_handle, - healthcheck->saAmfHealthcheckPeriod, - (void *)healthcheck, - timer_function_healthcheck_next_fn, - &healthcheck->timer_handle_period); + openais_timer_add ( + healthcheck->saAmfHealthcheckPeriod, + (void *)healthcheck, + timer_function_healthcheck_next_fn, + &healthcheck->timer_handle_period); } else if (invocationType == SA_AMF_HEALTHCHECK_COMPONENT_INVOKED) { /* start supervision timer */ - poll_timer_add (aisexec_poll_handle, + openais_timer_add ( healthcheck->saAmfHealthcheckPeriod, (void *)healthcheck, timer_function_healthcheck_tmo, @@ -1283,16 +1280,15 @@ int amf_comp_response_1 ( if (healthcheck->invocationType == SA_AMF_HEALTHCHECK_AMF_INVOKED) { /* the response was on time, delete supervision timer */ - poll_timer_delete (aisexec_poll_handle, - healthcheck->timer_handle_duration); + openais_timer_delete (healthcheck->timer_handle_duration); healthcheck->timer_handle_duration = 0; /* start timer to execute next healthcheck request */ - poll_timer_add (aisexec_poll_handle, - healthcheck->saAmfHealthcheckPeriod, - (void *)healthcheck, - timer_function_healthcheck_next_fn, - &healthcheck->timer_handle_period); + openais_timer_add ( + healthcheck->saAmfHealthcheckPeriod, + (void *)healthcheck, + timer_function_healthcheck_next_fn, + &healthcheck->timer_handle_period); *retval = SA_AIS_OK; } else { *retval = SA_AIS_ERR_INVALID_PARAM; @@ -1495,9 +1491,8 @@ SaAisErrorT amf_comp_healthcheck_confirm ( } else if (healthcheck->active) { if (healthcheckResult == SA_AIS_OK) { /* the response was on time, restart the supervision timer */ - poll_timer_delete (aisexec_poll_handle, - healthcheck->timer_handle_period); - poll_timer_add (aisexec_poll_handle, + openais_timer_delete (healthcheck->timer_handle_period); + openais_timer_add ( healthcheck->saAmfHealthcheckPeriod, (void *)healthcheck, timer_function_healthcheck_tmo, diff --git a/exec/amfsg.c b/exec/amfsg.c index 58b1dcff..43c57e2b 100644 --- a/exec/amfsg.c +++ b/exec/amfsg.c @@ -410,7 +410,7 @@ extern void amf_sg_su_state_changed ( TRACE1 ("All SUs in SG '%s' in service, assigning SIs\n", su->sg->name.value); amf_sg_assign_si (su->sg, 0); if (amf_cluster.timeout_handle) { - poll_timer_delete (aisexec_poll_handle, amf_cluster.timeout_handle); + openais_timer_delete (amf_cluster.timeout_handle); } } } diff --git a/exec/cfg.c b/exec/cfg.c index f032ff6d..5f42acf9 100644 --- a/exec/cfg.c +++ b/exec/cfg.c @@ -55,7 +55,6 @@ #include "../lcr/lcr_comp.h" #include "service.h" #include "totempg.h" -#include "aispoll.h" #include "mempool.h" #include "util.h" #include "print.h" diff --git a/exec/ckpt.c b/exec/ckpt.c index edfd6f9e..408bb274 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -55,7 +55,6 @@ #include "../include/queue.h" #include "../include/hdb.h" #include "../lcr/lcr_comp.h" -#include "aispoll.h" #include "service.h" #include "mempool.h" #include "tlist.h" diff --git a/exec/clm.c b/exec/clm.c index b5f6e78b..54b007ce 100644 --- a/exec/clm.c +++ b/exec/clm.c @@ -65,7 +65,6 @@ #include "../include/list.h" #include "../include/queue.h" #include "../lcr/lcr_comp.h" -#include "aispoll.h" #include "totempg.h" #include "main.h" #include "ipc.h" diff --git a/exec/cpg.c b/exec/cpg.c index abc8f4ac..03381d6c 100644 --- a/exec/cpg.c +++ b/exec/cpg.c @@ -55,7 +55,6 @@ #include "../include/list.h" #include "../include/queue.h" #include "../lcr/lcr_comp.h" -#include "aispoll.h" #include "totempg.h" #include "totemip.h" #include "main.h" diff --git a/exec/evs.c b/exec/evs.c index d8a836a1..14f2fbd0 100644 --- a/exec/evs.c +++ b/exec/evs.c @@ -55,7 +55,6 @@ #include "../include/list.h" #include "../include/queue.h" #include "../lcr/lcr_comp.h" -#include "aispoll.h" #include "totempg.h" #include "main.h" #include "ipc.h" diff --git a/exec/evt.c b/exec/evt.c index 39142198..6f2f790f 100644 --- a/exec/evt.c +++ b/exec/evt.c @@ -55,7 +55,6 @@ #include "../lcr/lcr_comp.h" #include "util.h" #include "service.h" -#include "aispoll.h" #include "mempool.h" #include "main.h" #include "ipc.h" diff --git a/exec/ipc.c b/exec/ipc.c index e6e49521..d02521ed 100644 --- a/exec/ipc.c +++ b/exec/ipc.c @@ -237,14 +237,6 @@ static int dispatch_init_send_response ( return (0); } - -/* - * pthread_kill interrupts poll so poll can reread its events descriptor - * via sigusr1 - */ -static void sigusr1_handler (int num) { -} - /* * Create a connection data structure */ @@ -811,8 +803,6 @@ void openais_ipc_init ( g_gid_valid = gid_valid; my_ip = my_ip_in; - - signal (SIGUSR1, sigusr1_handler); } diff --git a/exec/lck.c b/exec/lck.c index 63779549..f7572e0d 100644 --- a/exec/lck.c +++ b/exec/lck.c @@ -53,7 +53,6 @@ #include "../include/list.h" #include "../include/queue.h" #include "../lcr/lcr_comp.h" -#include "aispoll.h" #include "mempool.h" #include "util.h" #include "main.h" diff --git a/exec/main.c b/exec/main.c index e7e0c8a0..469c865d 100644 --- a/exec/main.c +++ b/exec/main.c @@ -384,6 +384,10 @@ int main (int argc, char **argv) totemip_localhost(AF_INET, &this_non_loopback_ip); + signal (SIGINT, sigintr_handler); + + signal (SIGUSR2, sigusr2_handler); + openais_timer_init ( serialize_mutex_lock, serialize_mutex_unlock); @@ -545,9 +549,6 @@ int main (int argc, char **argv) aisexec_mempool_init (); - signal (SIGINT, sigintr_handler); - signal (SIGUSR2, sigusr2_handler); - openais_ipc_init ( serialize_mutex_lock, serialize_mutex_unlock, diff --git a/exec/msg.c b/exec/msg.c index 4c9fbaa5..cce474ba 100644 --- a/exec/msg.c +++ b/exec/msg.c @@ -53,7 +53,6 @@ #include "../include/queue.h" #include "../lcr/lcr_comp.h" #include "service.h" -#include "aispoll.h" #include "mempool.h" #include "util.h" #include "main.h" diff --git a/exec/timer.c b/exec/timer.c index c0195fbb..028c2d6a 100644 --- a/exec/timer.c +++ b/exec/timer.c @@ -127,6 +127,9 @@ retry_poll: return (0); } +static void sigusr1_handler (int num) { +} + int openais_timer_init ( void (*serialize_lock_fn) (void), void (*serialize_unlock_fn) (void)) @@ -138,6 +141,8 @@ int openais_timer_init ( timerlist_init (&timers_timerlist); + signal (SIGUSR1, sigusr1_handler); + pthread_mutex_lock (&timer_mutex); pthread_attr_init (&thread_attr); pthread_attr_setstacksize (&thread_attr, 8192); @@ -169,7 +174,6 @@ int openais_timer_add ( pthread_kill (thread, SIGUSR1); - return (res); } diff --git a/exec/timer.h b/exec/timer.h index 0e1d516b..9897919e 100644 --- a/exec/timer.h +++ b/exec/timer.h @@ -37,6 +37,8 @@ #include "tlist.h" +typedef void * openais_timer_handle; + extern void openais_timer_init ( void (*serialize_lock) (void), void (*serialize_unlock) (void)); diff --git a/exec/util.c b/exec/util.c index 428f78f4..e69b9f98 100644 --- a/exec/util.c +++ b/exec/util.c @@ -40,7 +40,6 @@ #include "../include/saAis.h" #include "../include/list.h" -#include "aispoll.h" #include "util.h" #include "print.h"