lkml.org 
[lkml]   [2002]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[patch 2/4] timers: initialisers

Add some infrastructure for statically initialising timers,
use that in workqueues.



include/linux/timer.h | 9 +++++++++
1 files changed, 9 insertions(+)

--- 25/include/linux/timer.h~timer-initialiser Mon Nov 4 21:11:41 2002
+++ 25-akpm/include/linux/timer.h Mon Nov 4 21:11:49 2002
@@ -22,6 +22,15 @@ struct timer_list {

#define TIMER_MAGIC 0x4b87ad6e

+#define TIMER_INITIALIZER(_function, _expires, _data) { \
+ .function = (_function), \
+ .expires = (_expires), \
+ .data = (_data), \
+ .base = NULL, \
+ .magic = TIMER_MAGIC, \
+ .lock = SPIN_LOCK_UNLOCKED, \
+ }
+
/***
* init_timer - initialize a timer.
* @timer: the timer to be initialized
.

include/linux/workqueue.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
--- 25/include/linux/workqueue.h~work-initialiser Mon Nov 4 21:11:51 2002
+++ 25-akpm/include/linux/workqueue.h Mon Nov 4 21:12:06 2002
@@ -22,7 +22,9 @@ struct work_struct {
#define __WORK_INITIALIZER(n, f, d) { \
.entry = { &(n).entry, &(n).entry }, \
.func = (f), \
- .data = (d) }
+ .data = (d), \
+ .timer = TIMER_INITIALIZER(NULL, 0, 0), \
+ }

#define DECLARE_WORK(n, f, d) \
struct work_struct n = __WORK_INITIALIZER(n, f, d)
.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.694 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site