Просмотр исходного кода

Rename totem_new_msg_signal() to something more generic.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2553 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 16 лет назад
Родитель
Сommit
29eb20a389
7 измененных файлов с 19 добавлено и 6 удалено
  1. 3 2
      exec/totemmrp.c
  2. 1 1
      exec/totemmrp.h
  3. 6 1
      exec/totempg.c
  4. 1 1
      exec/totemsrp.c
  5. 1 1
      exec/totemsrp.h
  6. 5 0
      include/corosync/totem/totem.h
  7. 2 0
      include/corosync/totem/totempg.h

+ 3 - 2
exec/totemmrp.c

@@ -188,8 +188,9 @@ void totemmrp_callback_token_destroy (
 	totemsrp_callback_token_destroy (totemsrp_context, handle_out);
 	totemsrp_callback_token_destroy (totemsrp_context, handle_out);
 }
 }
 
 
-void totemmrp_new_msg_signal (void) {
-	totemsrp_new_msg_signal (totemsrp_context);
+void totemmrp_event_signal (enum totem_event_type type, int value)
+{
+	totemsrp_event_signal (totemsrp_context, type, value);
 }
 }
 
 
 int totemmrp_ifaces_get (
 int totemmrp_ifaces_get (

+ 1 - 1
exec/totemmrp.h

@@ -97,7 +97,7 @@ extern int totemmrp_callback_token_create (
 extern void totemmrp_callback_token_destroy (
 extern void totemmrp_callback_token_destroy (
 	void *handle_out);
 	void *handle_out);
 
 
-extern void totemmrp_new_msg_signal (void);
+extern void totemmrp_event_signal (enum totem_event_type type, int value);
 
 
 extern int totemmrp_ifaces_get (
 extern int totemmrp_ifaces_get (
 	unsigned int nodeid,
 	unsigned int nodeid,

+ 6 - 1
exec/totempg.c

@@ -773,7 +773,7 @@ static int mcast_msg (
 	int total_size = 0;
 	int total_size = 0;
 
 
 	pthread_mutex_lock (&mcast_msg_mutex);
 	pthread_mutex_lock (&mcast_msg_mutex);
-	totemmrp_new_msg_signal ();
+	totemmrp_event_signal (TOTEM_EVENT_NEW_MSG, 1);
 
 
 	/*
 	/*
 	 * Remove zero length iovectors from the list
 	 * Remove zero length iovectors from the list
@@ -1307,6 +1307,11 @@ int totempg_ifaces_get (
 	return (res);
 	return (res);
 }
 }
 
 
+void totempg_event_signal (enum totem_event_type type, int value)
+{
+	totemmrp_event_signal (type, value);
+}
+
 void* totempg_get_stats (void)
 void* totempg_get_stats (void)
 {
 {
 	return &totempg_stats;
 	return &totempg_stats;

+ 1 - 1
exec/totemsrp.c

@@ -2090,7 +2090,7 @@ originated:
 	return;
 	return;
 }
 }
 
 
-int totemsrp_new_msg_signal (void *srp_context)
+void totemsrp_event_signal (void *srp_context, enum totem_event_type type, int value)
 {
 {
 	struct totemsrp_instance *instance = (struct totemsrp_instance *)srp_context;
 	struct totemsrp_instance *instance = (struct totemsrp_instance *)srp_context;
 
 

+ 1 - 1
exec/totemsrp.h

@@ -92,7 +92,7 @@ void totemsrp_callback_token_destroy (
 	void *srp_context,
 	void *srp_context,
 	void **handle_out);
 	void **handle_out);
 
 
-int totemsrp_new_msg_signal (void *srp_context);
+void totemsrp_event_signal (void *srp_context, enum totem_event_type type, int value);
 
 
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 
 

+ 5 - 0
include/corosync/totem/totem.h

@@ -179,6 +179,11 @@ enum totem_callback_token_type {
 	TOTEM_CALLBACK_TOKEN_SENT = 2
 	TOTEM_CALLBACK_TOKEN_SENT = 2
 };
 };
 
 
+enum totem_event_type {
+	TOTEM_EVENT_DELIVERY_CONGESTED,
+	TOTEM_EVENT_NEW_MSG,
+};
+
 #define MEMB_RING_ID
 #define MEMB_RING_ID
 struct memb_ring_id {
 struct memb_ring_id {
 	struct totem_ip_address rep;
 	struct totem_ip_address rep;

+ 2 - 0
include/corosync/totem/totempg.h

@@ -145,6 +145,8 @@ extern int totempg_ifaces_get (
 
 
 extern void* totempg_get_stats (void);
 extern void* totempg_get_stats (void);
 
 
+void totempg_event_signal (enum totem_event_type type, int value);
+
 extern const char *totempg_ifaces_print (unsigned int nodeid);
 extern const char *totempg_ifaces_print (unsigned int nodeid);
 
 
 extern unsigned int totempg_my_nodeid_get (void);
 extern unsigned int totempg_my_nodeid_get (void);