From 3711a2fb7e84abf9ee9734d81e1f49f9a1f8877d Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 20 Mar 2021 15:48:22 +0200 Subject: 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. --- src/periodic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/periodic.h') 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. */ #include iDeclareType(Periodic) +iDeclareType(Thread) /* Animation utility. Not per frame but several times per second. */ struct Impl_Periodic { - int timer; iMutex * mutex; iSortedArray commands; + iCondition haveCommands; + iThread * thread; + iAtomicInt isStopping; }; void init_Periodic (iPeriodic *); -- cgit v1.2.3