cthreadpool · Section 3
cthrpool_declare
NAME
cthrpool_declare - declare an uninitialised thread pool variable
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadpool.h> cthrpool_declare(name);
DESCRIPTION
Expands to `cthrpool name` and leaves the variable uninitialized, so you must assign it with cthrpool_create() or cthrpool_create_mp() before you use it. The macro is there so that the naming matches the other c_collections modules.
PARAMETERS
name Variable name to declare.
EXAMPLES
cthrpool_declare(pool); char *err = NULL; pool = cthrpool_create(4, 128, &err); if (!pool) { fprintf(stderr, "%s\n", err); exit(1); } /* ... submit tasks ... */ cthrpool_shutdown_drain(pool); cthrpool_destroy(pool);
SEE ALSO
cthrpool_declare_scoped(3), cthrpool_construct(3), cthrpool_create(3)