diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-20 15:48:22 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-20 15:48:22 +0200 |
commit | 3711a2fb7e84abf9ee9734d81e1f49f9a1f8877d (patch) | |
tree | 2038ed9a8e5cde267ad0b9b51bf69e25ee056bb5 /src/periodic.h | |
parent | e009da58e2184ed209d118acd8343ae47276eae1 (diff) |
Periodic: Use a thread instead of timers
This still doesn't solve the strange refresh time issue.
Perhaps it's better to find a solution that doesn't rely on background threads.
Diffstat (limited to 'src/periodic.h')
-rw-r--r-- | src/periodic.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/periodic.h b/src/periodic.h index acb00aa2..c643a2fe 100644 --- a/src/periodic.h +++ b/src/periodic.h | |||
@@ -24,12 +24,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
24 | #include <the_Foundation/sortedarray.h> | 24 | #include <the_Foundation/sortedarray.h> |
25 | 25 | ||
26 | iDeclareType(Periodic) | 26 | iDeclareType(Periodic) |
27 | iDeclareType(Thread) | ||
27 | 28 | ||
28 | /* Animation utility. Not per frame but several times per second. */ | 29 | /* Animation utility. Not per frame but several times per second. */ |
29 | struct Impl_Periodic { | 30 | struct Impl_Periodic { |
30 | int timer; | ||
31 | iMutex * mutex; | 31 | iMutex * mutex; |
32 | iSortedArray commands; | 32 | iSortedArray commands; |
33 | iCondition haveCommands; | ||
34 | iThread * thread; | ||
35 | iAtomicInt isStopping; | ||
33 | }; | 36 | }; |
34 | 37 | ||
35 | void init_Periodic (iPeriodic *); | 38 | void init_Periodic (iPeriodic *); |