summaryrefslogtreecommitdiff
path: root/utils/loc_timer.h
diff options
context:
space:
mode:
authorDeven Patel <cdevenp@codeaurora.org>2016-03-15 12:20:01 -0700
committerDeven Patel <cdevenp@codeaurora.org>2016-03-15 12:20:01 -0700
commita376de48267adf99805cf7c0083cc10e06873b38 (patch)
tree101a4c80aaacf10706166167e295f5e7001ca800 /utils/loc_timer.h
parenta29688ff347be4972133eb11ccecaf03b0d3445e (diff)
downloadgps-a376de48267adf99805cf7c0083cc10e06873b38.tar.gz
Revert "Revert "Merging m_master changes to oe_master"."
This reverts commit a29688ff347be4972133eb11ccecaf03b0d3445e Change-Id: Iab525a58ddb6a00e119afe19f4f51b07b7f428f2
Diffstat (limited to 'utils/loc_timer.h')
-rw-r--r--utils/loc_timer.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/utils/loc_timer.h b/utils/loc_timer.h
index 5ca1586..2967858 100644
--- a/utils/loc_timer.h
+++ b/utils/loc_timer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,28 +33,38 @@
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#include<pthread.h>
-#include <platform_lib_log_util.h>
+#include <stddef.h>
/*
- Return values:
- Success = 0
- Failure = Non zero
+ user_data: client context pointer, passthrough. Originally received
+ from calling client when loc_timer_start() is called.
+ result: 0 if timer successfully timed out; else timer failed.
*/
-typedef void(*loc_timer_callback)(void *user_data, int result);
+typedef void (*loc_timer_callback)(void *user_data, int32_t result);
/*
- Returns the handle, which can be used to stop the timer
+ delay_msec: timeout value for the timer.
+ cb_func: callback function pointer, implemented by client.
+ Can not be NULL.
+ user_data: client context pointer, passthrough. Will be
+ returned when loc_timer_callback() is called.
+ wakeOnExpire: true if to wake up CPU (if sleeping) upon timer
+ expiration and notify the client.
+ false if to wait until next time CPU wakes up (if
+ sleeping) and then notify the client.
+ Returns the handle, which can be used to stop the timer
+ NULL, if timer start fails (e.g. if cb_func is NULL).
*/
-void* loc_timer_start(unsigned int delay_msec,
- loc_timer_callback,
- void* user_data);
+void* loc_timer_start(uint64_t delay_msec,
+ loc_timer_callback cb_func,
+ void *user_data,
+ bool wake_on_expire=false);
/*
- handle becomes invalid upon the return of the callback
+ handle becomes invalid upon the return of the callback
*/
-void loc_timer_stop(void* handle);
+void loc_timer_stop(void*& handle);
#ifdef __cplusplus
}