![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_thread_pool.h"Go to the source code of this file.
Functions | |
| static int | all_ones (const int *items, size_t count) |
| every item is exactly one | |
| static void | bump (size_t begin, size_t end, void *user) |
| add one to each item of the slice, so a slice done twice shows as a 2 | |
| static void | expect_true (const char *what, int ok) |
| report a check | |
| int | main (void) |
| static void * | nested (void *arg) |
| a loop run from another thread, as a pool worker would | |
Variables | |
| static int | failures = 0 |
| count of failed checks | |
|
static |
every item is exactly one
Definition at line 50 of file ex_parallel_for.c.
Referenced by main().
|
static |
add one to each item of the slice, so a slice done twice shows as a 2
Definition at line 36 of file ex_parallel_for.c.
Referenced by main(), and nested().
|
static |
report a check
Definition at line 28 of file ex_parallel_for.c.
| int main | ( | void | ) |
Definition at line 58 of file ex_parallel_for.c.
References all_ones(), bump(), expect_true(), failures, get_nb_cpu_cores(), LOG_NOTICE, n_log, n_parallel_for(), nested(), and set_log_level().
|
static |
a loop run from another thread, as a pool worker would
Definition at line 44 of file ex_parallel_for.c.
References bump(), and n_parallel_for().
Referenced by main().
|
static |
count of failed checks
Definition at line 25 of file ex_parallel_for.c.