Browse Source

Add timer_time_get to the corosync API.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1760 fd59a12c-fef9-0310-b244-a6a79926bd2f
Ryan O'Hara 17 years ago
parent
commit
f116dce6f2
3 changed files with 8 additions and 1 deletions
  1. 1 1
      exec/apidef.c
  2. 5 0
      exec/timer.c
  3. 2 0
      exec/timer.h

+ 1 - 1
exec/apidef.c

@@ -71,7 +71,7 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.timer_add_duration = corosync_timer_add_duration,
 	.timer_add_duration = corosync_timer_add_duration,
 	.timer_add_absolute = corosync_timer_add_absolute,
 	.timer_add_absolute = corosync_timer_add_absolute,
 	.timer_delete = corosync_timer_delete,
 	.timer_delete = corosync_timer_delete,
-	.timer_time_get = NULL,
+	.timer_time_get = corosync_timer_time_get,
 	.ipc_source_set = message_source_set,
 	.ipc_source_set = message_source_set,
 	.ipc_source_is_local = message_source_is_local,
 	.ipc_source_is_local = message_source_is_local,
 	.ipc_private_data_get = cs_conn_private_data_get,
 	.ipc_private_data_get = cs_conn_private_data_get,

+ 5 - 0
exec/timer.c

@@ -262,3 +262,8 @@ void corosync_timer_unlock (void)
 {
 {
 	pthread_mutex_unlock (&timer_mutex);
 	pthread_mutex_unlock (&timer_mutex);
 }
 }
+
+unsigned long long corosync_timer_time_get (void)
+{
+	return (timerlist_nano_from_epoch());
+}

+ 2 - 0
exec/timer.h

@@ -61,4 +61,6 @@ extern void corosync_timer_lock (void);
 
 
 extern void corosync_timer_unlock (void);
 extern void corosync_timer_unlock (void);
 
 
+extern unsigned long long corosync_timer_time_get (void);
+
 #endif /* TIMER_H_DEFINED */
 #endif /* TIMER_H_DEFINED */