summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
authorfcolin2006-04-19 08:28:14 +0000
committerfcolin2006-04-19 08:28:14 +0000
commit6bf117656574521545694a1a4e5169755077631e (patch)
treef18c164c217e2279781a3af9851b644da97dfba1 /src/timer.c
parentca9eddefaec96a20b88b9aba25a9384037317c91 (diff)
downloadivy-c-6bf117656574521545694a1a4e5169755077631e.zip
ivy-c-6bf117656574521545694a1a4e5169755077631e.tar.gz
ivy-c-6bf117656574521545694a1a4e5169755077631e.tar.bz2
ivy-c-6bf117656574521545694a1a4e5169755077631e.tar.xz
correction de probleme potentiel en multithread ( Ada rejeu )
ajout d'un warning en cas de client bloquant si la varaiable d'env IVY_DEBUG_SEND est positionne
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/timer.c b/src/timer.c
index f147232..565271e 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -103,18 +103,16 @@ TimerId TimerRepeatAfter( int count, long time, TimerCb cb, void *user_data )
/* si y a rien a faire et ben on fait rien */
if ( cb == NULL ) return NULL;
- IVY_LIST_ADD( timers, timer )
- if ( timer )
- {
- timer->repeat = count;
- timer->callback = cb;
- timer->user_data = user_data;
- stamp = currentTime();
- timer->period = time;
- timer->when = stamp + time;
- if ( (timer->when < nextTimeout) || (timeoutptr == NULL))
- SetNewTimeout( stamp, timer->when );
- }
+ IVY_LIST_ADD_START( timers, timer )
+ timer->repeat = count;
+ timer->callback = cb;
+ timer->user_data = user_data;
+ stamp = currentTime();
+ timer->period = time;
+ timer->when = stamp + time;
+ if ( (timer->when < nextTimeout) || (timeoutptr == NULL))
+ SetNewTimeout( stamp, timer->when );
+ IVY_LIST_ADD_END( timers, timer )
return timer;
}
void TimerRemove( TimerId timer )