Re: [PATCH 1/5] lib: introduce call_once()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Monday, March 10, 2008 - 8:48 pm

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();

?
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/5] lib: introduce call_once(), Akinobu Mita, (Mon Mar 10, 7:57 am)
[PATCH 2/5] idr: use call_once(), Akinobu Mita, (Mon Mar 10, 8:00 am)
[PATCH 3/5] hugetlbfs: use call_once(), Akinobu Mita, (Mon Mar 10, 8:01 am)
[PATCH 4/5] shmem: use call_once(), Akinobu Mita, (Mon Mar 10, 8:03 am)
[PATCH 5/5] tiny-shmem: use call_once(), Akinobu Mita, (Mon Mar 10, 8:05 am)
Re: [PATCH 1/5] lib: introduce call_once(), Joe Perches, (Mon Mar 10, 8:29 am)
Re: [PATCH 4/5] shmem: use call_once(), Hugh Dickins, (Mon Mar 10, 3:15 pm)
Re: [PATCH 1/5] lib: introduce call_once(), Andrew Morton, (Mon Mar 10, 8:48 pm)
Re: [PATCH 1/5] lib: introduce call_once(), Nick Piggin, (Mon Mar 10, 9:10 pm)
Re: [PATCH 1/5] lib: introduce call_once(), Andrew Morton, (Mon Mar 10, 9:21 pm)
Re: [PATCH 1/5] lib: introduce call_once(), Akinobu Mita, (Tue Mar 11, 5:17 am)
Re: [PATCH 1/5] lib: introduce call_once(), Akinobu Mita, (Tue Mar 11, 5:27 am)
Re: [PATCH 4/5] shmem: use call_once(), Akinobu Mita, (Tue Mar 11, 5:29 am)
Re: [PATCH 1/5] lib: introduce call_once(), Nick Piggin, (Tue Mar 11, 5:41 am)
Re: [PATCH 4/5] shmem: use call_once(), Hugh Dickins, (Tue Mar 11, 6:41 am)
Re: [PATCH 1/5] lib: introduce call_once(), Andrew Morton, (Tue Mar 11, 10:35 am)
Re: [PATCH 1/5] lib: introduce call_once(), Joe Perches, (Tue Mar 11, 11:56 am)
Re: [PATCH 1/5] lib: introduce call_once(), Andrew Morton, (Tue Mar 11, 12:11 pm)
Re: [PATCH 1/5] lib: introduce call_once(), Akinobu Mita, (Fri Mar 14, 9:01 pm)