[Openais] [PATCH]: corosync/trunk: Add timer_time_get to corosync api
Ryan O'Hara
rohara at redhat.com
Fri Feb 13 16:06:04 PST 2009
This patch adds timer_time_get to the corosync api. It will return the
current time as 64-bit unsigned integer.
-------------- next part --------------
Index: exec/apidef.c
===================================================================
--- exec/apidef.c (revision 1759)
+++ exec/apidef.c (working copy)
@@ -71,7 +71,7 @@
.timer_add_duration = corosync_timer_add_duration,
.timer_add_absolute = corosync_timer_add_absolute,
.timer_delete = corosync_timer_delete,
- .timer_time_get = NULL,
+ .timer_time_get = corosync_timer_time_get,
.ipc_source_set = message_source_set,
.ipc_source_is_local = message_source_is_local,
.ipc_private_data_get = cs_conn_private_data_get,
Index: exec/timer.c
===================================================================
--- exec/timer.c (revision 1759)
+++ exec/timer.c (working copy)
@@ -262,3 +262,8 @@
{
pthread_mutex_unlock (&timer_mutex);
}
+
+unsigned long long corosync_timer_time_get (void)
+{
+ return (timerlist_nano_from_epoch());
+}
Index: exec/timer.h
===================================================================
--- exec/timer.h (revision 1759)
+++ exec/timer.h (working copy)
@@ -61,4 +61,6 @@
extern void corosync_timer_unlock (void);
+extern unsigned long long corosync_timer_time_get (void);
+
#endif /* TIMER_H_DEFINED */
More information about the Openais
mailing list