pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/wm/enlightenment16 enlightenment16: fix timer lockup i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3067975d8530
branches:  trunk
changeset: 388082:3067975d8530
user:      gutteridge <gutteridge%pkgsrc.org@localhost>
date:      Sun Nov 13 00:52:01 2022 +0000

description:
enlightenment16: fix timer lockup issue

diffstat:

 wm/enlightenment16/Makefile                   |    3 +-
 wm/enlightenment16/distinfo                   |    3 +-
 wm/enlightenment16/patches/patch-src_timers.c |  109 ++++++++++++++++++++++++++
 3 files changed, 113 insertions(+), 2 deletions(-)

diffs (138 lines):

diff -r 9938f9c8811a -r 3067975d8530 wm/enlightenment16/Makefile
--- a/wm/enlightenment16/Makefile       Sat Nov 12 23:33:00 2022 +0000
+++ b/wm/enlightenment16/Makefile       Sun Nov 13 00:52:01 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.23 2022/10/24 16:48:19 gutteridge Exp $
+# $NetBSD: Makefile,v 1.24 2022/11/13 00:52:01 gutteridge Exp $
 
 DISTNAME=      e16-1.0.26
 PKGNAME=       ${DISTNAME:S/e/enlightenment/}
+PKGREVISION=   1
 CATEGORIES=    wm x11
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=enlightenment/}
 
diff -r 9938f9c8811a -r 3067975d8530 wm/enlightenment16/distinfo
--- a/wm/enlightenment16/distinfo       Sat Nov 12 23:33:00 2022 +0000
+++ b/wm/enlightenment16/distinfo       Sun Nov 13 00:52:01 2022 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.10 2022/10/24 16:48:19 gutteridge Exp $
+$NetBSD: distinfo,v 1.11 2022/11/13 00:52:01 gutteridge Exp $
 
 BLAKE2s (e16-1.0.26.tar.gz) = a6bb822d20004fbed92e04243d5dad64063a4908f46e5b5f9c9c505281908b22
 SHA512 (e16-1.0.26.tar.gz) = 4a14fd7df5621bc291b053b9da4a1d384b058e8099d6c4856f8ec334559ee8b9346e13f1609909402932dead6ffd9cc3d3f9a36401a38bebe9ec3d4335015926
 Size (e16-1.0.26.tar.gz) = 2407581 bytes
 SHA1 (patch-ac) = a5a2f2b0377212178480cc94e6975dd4ff364ced
+SHA1 (patch-src_timers.c) = 556b2d5a36c029e108a6554c42f37c17b50ed5b0
diff -r 9938f9c8811a -r 3067975d8530 wm/enlightenment16/patches/patch-src_timers.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/wm/enlightenment16/patches/patch-src_timers.c     Sun Nov 13 00:52:01 2022 +0000
@@ -0,0 +1,109 @@
+$NetBSD: patch-src_timers.c,v 1.1 2022/11/13 00:52:01 gutteridge Exp $
+
+Fix timer lockup issue.
+Upstream commit 6a0c30e77ff598e90d38dd3c58f4552a996ab4b5.
+
+--- src/timers.c.orig  2022-05-28 14:15:04.000000000 +0000
++++ src/timers.c
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
+- * Copyright (C) 2006-2019 Kim Woelders
++ * Copyright (C) 2006-2022 Kim Woelders
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a copy
+  * of this software and associated documentation files (the "Software"), to
+@@ -25,6 +25,13 @@
+ #include "list.h"
+ #include "timers.h"
+ 
++#define DEBUG_TIMERS 0
++#if DEBUG_TIMERS
++#define Dprintf(fmt...) if(EDebug(EDBUG_TYPE_TIMERS))Eprintf(fmt)
++#else
++#define Dprintf(fmt...)
++#endif
++
+ struct _timer {
+    unsigned int        in_time;
+    unsigned int        at_time;
+@@ -109,14 +116,19 @@ TimerAdd(int dt_ms, int (*func)(void *da
+ void
+ TimersRun(unsigned int t_ms)
+ {
+-   Timer              *timer, *q_old, *q_run;
++   Timer              *timer, *q_old, *q_new, *q_run;
+ 
+    timer = q_first;
+    if (!timer)
+       return;                 /* No timers pending */
+ 
+-   q_run = q_old = timer;
+-   for (; timer; timer = q_first)
++   Dprintf("%s - A\n", __func__);
++
++   q_new = timer;             /* q_new is now temporarily the timer queue */
++   q_old = timer;             /* q_old is the old timer queue */
++   q_first = NULL;            /* q_first holds timers added during timer processing */
++   q_run = NULL;              /* q_run holds the last run timer */
++   for (; timer; timer = q_new)
+      {
+       if (tdiff(timer->at_time, t_ms) > 0)
+          break;
+@@ -125,22 +137,25 @@ TimersRun(unsigned int t_ms)
+          Eprintf("%s - run %p: func=%p data=%p: %8d\n", __func__, timer,
+                  timer->func, timer->data, timer->at_time - t_ms);
+ 
+-      q_first = timer->next;
++      q_new = timer->next;
+ 
+       /* Run this callback */
+       timer->again = timer->func(timer->data);
+       q_run = timer;
+      }
+ 
+-   if (q_old != q_first)
++   if (q_run)
+      {
+       /* At least one timer has run */
+       q_run->next = NULL;     /* Terminate expired timer list */
+ 
+       /* Re-schedule/remove timers that have run */
+-      for (timer = q_old; timer; timer = q_old)
++      q_run = q_new;          /* Swap q_first and q_new ... */
++      q_new = q_first;        /* q_new are the new added timers */
++      q_first = q_run;        /* q_first is now the timer queue */
++      for (timer = q_old; timer; timer = q_run)
+         {
+-           q_old = timer->next;
++           q_run = timer->next;
+            if (timer->again)
+              {
+                 timer->at_time += timer->in_time;
+@@ -151,6 +166,17 @@ TimersRun(unsigned int t_ms)
+                 _TimerDel(timer);
+              }
+         }
++
++      /* Schedule timers that have been added */
++      for (timer = q_new; timer; timer = q_run)
++        {
++           q_run = timer->next;
++           _TimerSet(timer);  /* Add to timer queue */
++        }
++     }
++   else
++     {
++      q_first = q_old;        /* Restore timer queue */
+      }
+ 
+    if (EDebug(EDBUG_TYPE_TIMERS) > 1)
+@@ -160,6 +186,8 @@ TimersRun(unsigned int t_ms)
+                  timer, timer->func, timer->data, timer->at_time - t_ms,
+                  timer->in_time);
+      }
++
++   Dprintf("%s - B\n", __func__);
+ }
+ 
+ int



Home | Main Index | Thread Index | Old Index