atomic_flag type provides the classic test-and-set functionality.
It has two states, set (value is non-zero) and clear (value is 0).
Operations on an object of type
atomic_flag shall be lock free.
ATOMIC_FLAG_INIT may be used to initialize an
atomic_flag to the
atomic_flag that is not explicitly initialized with
initially in an indeterminate state.
This macro can only be used for atomic objects that are declared in program
scope in the
global address space with the
global atomic_flag guard = `ATOMIC_FLAG_INIT`;
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.