On Mon, 10 Mar 2008 23:57:05 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
I don't believe that this shold be described in terms of an "init_routine".
This mechanism can be used for things other than initialisation routines.
It is spelled "routine", not "rouine".
Would it not be simpler and more general to do:
#define ONCE() \
({ \
static long flag; \
\
return !test_and_set_bit(0, flag); \
})
and then callers can do
if (ONCE())
do_something();
?
--