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
This commit is contained in:
Steven Dake 2005-06-28 19:01:25 +00:00
parent 2b3bcfb6e0
commit 91c6b6d699
6 changed files with 630 additions and 186 deletions

View File

@ -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;

View File

@ -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 suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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);

View File

@ -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,