summaryrefslogtreecommitdiff
path: root/src/periodic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/periodic.h')
-rw-r--r--src/periodic.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/periodic.h b/src/periodic.h
index c643a2fe..db90b848 100644
--- a/src/periodic.h
+++ b/src/periodic.h
@@ -26,17 +26,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
26iDeclareType(Periodic) 26iDeclareType(Periodic)
27iDeclareType(Thread) 27iDeclareType(Thread)
28 28
29/* Animation utility. Not per frame but several times per second. */ 29/* Animation utility. Not per frame but several times per second. Thread safe. */
30struct Impl_Periodic { 30struct Impl_Periodic {
31 iMutex * mutex; 31 iMutex * mutex;
32 iSortedArray commands; 32 iSortedArray commands;
33 iCondition haveCommands; 33 uint32_t lastPostTime;
34 iThread * thread;
35 iAtomicInt isStopping;
36}; 34};
37 35
38void init_Periodic (iPeriodic *); 36void init_Periodic (iPeriodic *);
39void deinit_Periodic (iPeriodic *); 37void deinit_Periodic (iPeriodic *);
40 38
41void add_Periodic (iPeriodic *, iAny *context, const char *command); 39iLocalDef iBool isEmpty_Periodic(const iPeriodic *d) {
42void remove_Periodic (iPeriodic *, iAny *context); 40 return isEmpty_SortedArray(&d->commands);
41}
42
43void add_Periodic (iPeriodic *, iAny *context, const char *command);
44void remove_Periodic (iPeriodic *, iAny *context);
45
46iBool postCommands_Periodic (iPeriodic *);