Include the header <boost/thread/once.hpp>
to define the
once_flag type and
call_once function and
once_flag type (statically
BOOST_ONCE_INIT) can be used to run a routine exactly
once. This can be used to initialize data in a
#define BOOST_ONCE_INIT implementation defined
This is a constant value used to initialize
to indicate that the logically associated routine has not been run yet.
typedef implementation defined once_flag;
This implementation defined type is used as a flag to insure a routine is called
only once. Instances of this type should be statically initialized to
void call_once(void (*func)(), once_flag& flag);
funcshall not throw exceptions.
if (flag == BOOST_ONCE_INIT) func();
flag != BOOST_ONCE_INIT
Revised 05 November, 2001
© Copyright William E. Kempf 2001-2002. All Rights Reserved.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. William E. Kempf makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.