lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Mar 2008 11:56:55 -0700
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Akinobu Mita <akinobu.mita@...il.com>, nickpiggin@...oo.com.au,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] lib: introduce call_once()

On Tue, 2008-03-11 at 10:35 -0700, Andrew Morton wrote:
> #define ONCE()                                              \
>     ({                                              \
>             static long flag;                       \
>                                                     \
>             return !test_and_set_bit(0, flag);      \
>     })

test_and_set_bit takes an address

Perhaps:

#define DO_ONCE(x) \
	({ static long flag; if (test_and_set_bit(0, &flag)) x; 1; })

DO_ONCE(foo);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ