"Dinkum/threads/once"


call_once · once_flag · once_init


Include the header "Dinkum/threads/once" to use once functions in C++ code.

namespace Dinkum {
    namespace threads {
    typedef o-type once_flag;
    const once_flag once_init = .....;
    void call_once(void (*func)(void), once_flag& flag);
    }  // namespace threads
} // namespace Dinkum

call_once

void call_once(void (*func)(void), once_flag& flag);

The function uses flag to ensure that func is called exactly once.

once_flag

typedef o-type once_flag;

The type describes a data object for use as the first argument to call_once.

once_init

const once_flag once_init = .....;

The object provides an initial value for objects of type once_flag.


See also the Table of Contents and the Index.

Copyright © 1992-2013 by Dinkumware, Ltd. Portions derived from work copyright © 2001 by William E. Kempf. All rights reserved.