Jelajahi Sumber

Patch from Muni Bajpai to improve synchronization after a merge.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@713 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 20 tahun lalu
induk
melakukan
91c6b6d699
6 mengubah file dengan 545 tambahan dan 129 penghapusan
  1. 26 0
      exec/aispoll.c
  2. 4 0
      exec/aispoll.h
  3. 500 127
      exec/ckpt.c
  4. 11 0
      exec/tlist.c
  5. 2 0
      exec/tlist.h
  6. 2 2
      test/testckpt.c

+ 26 - 0
exec/aispoll.c

@@ -342,6 +342,32 @@ error_exit:
 	return (-1);
 }
 
+int poll_timer_delete_data (
+	poll_handle handle,
+	poll_timer_handle timer_handle) {
+	struct poll_instance *poll_instance;
+	SaErrorT error;
+
+	if (timer_handle == 0) {
+		return (0);
+	}
+	error = saHandleInstanceGet (&poll_instance_database, handle,
+		(void *)&poll_instance);
+	if (error != SA_OK) {
+		goto error_exit;
+	}
+
+	timerlist_del_data (&poll_instance->timerlist, (void *)timer_handle);
+
+	saHandleInstancePut (&poll_instance_database, handle);
+
+	return (0);
+
+error_exit:
+        return (-1);
+
+}
+
 
 int poll_entry_compare (const void *a, const void *b) {
 	struct poll_entry *poll_entry_a = (struct poll_entry *)a;

+ 4 - 0
exec/aispoll.h

@@ -71,6 +71,10 @@ int poll_timer_delete (
 	poll_handle handle,
 	poll_timer_handle timer_handle);
 
+int poll_timer_delete_data (
+        poll_handle handle,
+        poll_timer_handle timer_handle);
+
 int poll_run (
 	poll_handle handle);
 

File diff ditekan karena terlalu besar
+ 500 - 127
exec/ckpt.c


+ 11 - 0
exec/tlist.c

@@ -147,6 +147,17 @@ void timerlist_del (struct timerlist *timerlist, timer_handle timer_handle)
 	timers_inuse--;
 	free (timer);
 }
+
+void timerlist_del_data (struct timerlist *timerlist, timer_handle timer_handle)
+{
+	struct timer *timer = (struct timer *)timer_handle;
+
+	if (timer->data) {
+		free (timer->data);
+	}
+	timerlist_del(timerlist,timer_handle);
+}
+
 static void timerlist_pre_dispatch (struct timerlist *timerlist, timer_handle timer_handle)
 {
 	struct timer *timer = (struct timer *)timer_handle;

+ 2 - 0
exec/tlist.h

@@ -57,6 +57,8 @@ timer_handle timerlist_add_future (struct timerlist *timerlist,
 
 void timerlist_del (struct timerlist *timerlist, timer_handle timer_handle);
 
+void timerlist_del_data (struct timerlist *timerlist, timer_handle timer_handle);
+
 void timerlist_expire (struct timerlist *timerlist);
 
 unsigned int timerlist_timeout_msec (struct timerlist *timerlist);

+ 2 - 2
test/testckpt.c

@@ -316,7 +316,7 @@ printf ("Please wait, testing expiry of checkpoint sections.\n");
 		0,
 		&checkpointHandle2);
 	printf ("%s: Opening unlinked checkpoint\n", 
-		get_test_output (error, 7));
+		get_test_output (error, SA_AIS_OK));
 
 	error = saCkptCheckpointClose (checkpointHandle);
 	printf ("%s: Closing checkpoint\n", 
@@ -394,7 +394,7 @@ printf ("Please wait, testing expiry of checkpoint sections.\n");
 									"Initial Data #2",
 									strlen ("Initial Data #2") + 1);
 	printf ("%s: creating section 2 \n",
-		get_test_output (error, SA_AIS_OK));
+		get_test_output (error, SA_AIS_ERR_EXIST));
 
 	error = saCkptSectionExpirationTimeSet (checkpointHandle,
 		&sectionId2,

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini