libcthreads(3)
π NAME π
okay so this is libcthreads(3) from the Library Functions Manual, and the name on the tin is: libcthreads.h β Library to support cross-platform C threads functions. Bestie, itβs the cross-platform C threads library page, and weβre gonna go through it together π
β¨ SYNOPSIS β¨
First thing, the include:
#include <libcthreads.h>
Then the function families, all categorized exactly like the page says. Copy-paste ready, no cap π«Ά
π Support functions π
const char *
libcthreads_get_version(void);
π Error functions π
void
libcthreads_error_free(libcthreads_error_t **error);
int
libcthreads_error_fprint(libcthreads_error_t *error, FILE *stream);
int
libcthreads_error_sprint(libcthreads_error_t *error, char *string,
size_t size);
int
libcthreads_error_backtrace_fprint(libcthreads_error_t *error,
FILE *stream);
int
libcthreads_error_backtrace_sprint(libcthreads_error_t *error,
char *string, size_t size);
π Thread functions π
int
libcthreads_thread_create(libcthreads_thread_t **thread,
const libcthreads_thread_attributes_t *thread_attributes,
int (*callback_function)( void *arguments ),
void *callback_function_arguments, libcthreads_error_t **error);
int
libcthreads_thread_join(libcthreads_thread_t **thread,
libcthreads_error_t **error);
π Thread attributes functions π
int
libcthreads_thread_attributes_initialize(libcthreads_thread_attributes_t **thread_attributes,
libcthreads_error_t **error);
int
libcthreads_thread_attributes_free(libcthreads_thread_attributes_t **thread_attributes,
libcthreads_error_t **error);
π Condition functions π
int
libcthreads_condition_initialize(libcthreads_condition_t **condition,
libcthreads_error_t **error);
int
libcthreads_condition_free(libcthreads_condition_t **condition,
libcthreads_error_t **error);
int
libcthreads_condition_broadcast(libcthreads_condition_t *condition,
libcthreads_error_t **error);
int
libcthreads_condition_signal(libcthreads_condition_t *condition,
libcthreads_error_t **error);
int
libcthreads_condition_wait(libcthreads_condition_t *condition,
libcthreads_mutex_t *mutex, libcthreads_error_t **error);
π Lock functions π
int
libcthreads_lock_initialize(libcthreads_lock_t **lock,
libcthreads_error_t **error);
int
libcthreads_lock_free(libcthreads_lock_t **lock,
libcthreads_error_t **error);
int
libcthreads_lock_grab(libcthreads_lock_t *lock,
libcthreads_error_t **error);
int
libcthreads_lock_release(libcthreads_lock_t *lock,
libcthreads_error_t **error);
π Mutex functions π
int
libcthreads_mutex_initialize(libcthreads_mutex_t **mutex,
libcthreads_error_t **error);
int
libcthreads_mutex_free(libcthreads_mutex_t **mutex,
libcthreads_error_t **error);
int
libcthreads_mutex_grab(libcthreads_mutex_t *mutex,
libcthreads_error_t **error);
int
libcthreads_mutex_try_grab(libcthreads_mutex_t *mutex,
libcthreads_error_t **error);
int
libcthreads_mutex_release(libcthreads_mutex_t *mutex,
libcthreads_error_t **error);
π Read/Write lock functions π
int
libcthreads_read_write_lock_initialize(libcthreads_read_write_lock_t **read_write_lock,
libcthreads_error_t **error);
int
libcthreads_read_write_lock_free(libcthreads_read_write_lock_t **read_write_lock,
libcthreads_error_t **error);
int
libcthreads_read_write_lock_grab_for_read(libcthreads_read_write_lock_t *read_write_lock,
libcthreads_error_t **error);
int
libcthreads_read_write_lock_grab_for_write(libcthreads_read_write_lock_t *read_write_lock,
libcthreads_error_t **error);
int
libcthreads_read_write_lock_release_for_read(libcthreads_read_write_lock_t *read_write_lock,
libcthreads_error_t **error);
int
libcthreads_read_write_lock_release_for_write(libcthreads_read_write_lock_t *read_write_lock,
libcthreads_error_t **error);
π Queue functions π
int
libcthreads_queue_initialize(libcthreads_queue_t **queue,
int maximum_number_of_values, libcthreads_error_t **error);
int
libcthreads_queue_free(libcthreads_queue_t **queue,
int (*value_free_function)( intptr_t **value, libcthreads_error_t **error ),
libcthreads_error_t **error);
int
libcthreads_queue_empty(libcthreads_queue_t *queue,
libcthreads_error_t **error);
int
libcthreads_queue_try_pop(libcthreads_queue_t *queue, intptr_t **value,
libcthreads_error_t **error);
int
libcthreads_queue_pop(libcthreads_queue_t *queue, intptr_t **value,
libcthreads_error_t **error);
int
libcthreads_queue_try_push(libcthreads_queue_t *queue, intptr_t *value,
libcthreads_error_t **error);
int
libcthreads_queue_push(libcthreads_queue_t *queue, intptr_t *value,
libcthreads_error_t **error);
int
libcthreads_queue_push_sorted(libcthreads_queue_t *queue,
intptr_t *value,
int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcthreads_error_t **error ),
uint8_t sort_flags, libcthreads_error_t **error);
π Thread pool functions π
int
libcthreads_thread_pool_create(libcthreads_thread_pool_t **thread_pool,
const libcthreads_thread_attributes_t *thread_attributes,
int number_of_threads, int maximum_number_of_values,
int (*callback_function)( intptr_t *value, void *arguments ),
void *callback_function_arguments, libcthreads_error_t **error);
int
libcthreads_thread_pool_push(libcthreads_thread_pool_t *thread_pool,
intptr_t *value, libcthreads_error_t **error);
int
libcthreads_thread_pool_push_sorted(libcthreads_thread_pool_t *thread_pool,
intptr_t *value,
int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcthreads_error_t **error ),
uint8_t sort_flags, libcthreads_error_t **error);
int
libcthreads_thread_pool_join(libcthreads_thread_pool_t **thread_pool,
libcthreads_error_t **error);
πΈ DESCRIPTION πΈ
The libcthreads_get_version() function is used to retrieve the library version. Thatβs the whole description, bestie β short and iconic β¨
π RETURN VALUES π
Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libcthreads.h".
quick vibe check: it really does depend on the return type, so donβt go assuming every single function returns the same thing π
π¦ ENVIRONMENT π¦
None.
π FILES π
None.
π BUGS π
Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libcthreads/issues
π§ AUTHOR π§
These man pages are generated from "libcthreads.h".
π COPYRIGHT π
Copyright (C) 2012-2024, Joachim Metz <joachim.metz@gmail.com>.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
π SEE ALSO π
the libcthreads.h include file
mwah π β source/version: libcthreads; date: March 11, 2019; manual: libcthreads(3).
π¦ where this page comes from
- opensuse-leap 16.0: libcthreads-devel 20240413-bp160.1.12 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcthreads-devel 20240413-bp160.1.12 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcthreads-devel 20240413-bp160.1.12 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcthreads-devel 20240413-bp160.1.12 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms