O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
thread.c File Reference

Thread-specific global and function. More...

#include "o2s/thread.h"
#include <pthread.h>
#include <string.h>

Go to the source code of this file.

Functions

void o2s_thread_set_name (const char *name)
 Sets both the O2S thread name and the POSIX thread name (/proc/self/task/tid/comm).

Variables

thread_local char o2s_thread_name [8]
 Thread name, used when logging.

Detailed Description

Thread-specific global and function.

Author
Antoine GAGNIERE

Definition in file thread.c.

Function Documentation

◆ o2s_thread_set_name()

void o2s_thread_set_name ( const char * name)

Sets both the O2S thread name and the POSIX thread name (/proc/self/task/tid/comm).

The name will be visible in GDB, htop, etc

Parameters
namemust be a null-terminated character string, preferably a string literal

Definition at line 32 of file thread.c.

Variable Documentation

◆ o2s_thread_name

thread_local char o2s_thread_name[8]

Thread name, used when logging.

The name can be 8 characters long at most

Definition at line 25 of file thread.c.