diff options
Diffstat (limited to 'src/periodic.h')
-rw-r--r-- | src/periodic.h | 16 |
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. */ | |||
26 | iDeclareType(Periodic) | 26 | iDeclareType(Periodic) |
27 | iDeclareType(Thread) | 27 | iDeclareType(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. */ |
30 | struct Impl_Periodic { | 30 | struct 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 | ||
38 | void init_Periodic (iPeriodic *); | 36 | void init_Periodic (iPeriodic *); |
39 | void deinit_Periodic (iPeriodic *); | 37 | void deinit_Periodic (iPeriodic *); |
40 | 38 | ||
41 | void add_Periodic (iPeriodic *, iAny *context, const char *command); | 39 | iLocalDef iBool isEmpty_Periodic(const iPeriodic *d) { |
42 | void remove_Periodic (iPeriodic *, iAny *context); | 40 | return isEmpty_SortedArray(&d->commands); |
41 | } | ||
42 | |||
43 | void add_Periodic (iPeriodic *, iAny *context, const char *command); | ||
44 | void remove_Periodic (iPeriodic *, iAny *context); | ||
45 | |||
46 | iBool postCommands_Periodic (iPeriodic *); | ||