Parallel computing and synchronization via POSIX Threads.
More...
|
| #define | do_once(once, block) |
| | Executes the given block at most one time.
|
| |
|
| typedef long | Once |
| | The Once type.
|
| |
◆ do_once
| #define do_once |
( |
|
once, |
|
|
|
block |
|
) |
| |
Value: if (__sync_val_compare_and_swap(once, 0, -1) == 0) { \
block; *once = 1; \
} else { \
while (*once != 1) ; \
}
Executes the given block at most one time.
Definition at line 43 of file Once.h.
44 { \
45 block; *once = 1; \
46 } else { \
47 while (*once != 1) ; \
48 }
◆ Once
The Once type.
Definition at line 37 of file Once.h.