Loading...
Searching...
No Matches
pthread_threading.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 René Kijewski <rene.kijewski@fu-berlin.de>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#include "kernel_defines.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
26typedef unsigned pthread_t;
27
44int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
45
53void pthread_exit(void *retval) NORETURN;
54
66int pthread_join(pthread_t th, void **thread_return);
67
82
91
96static inline int pthread_equal(pthread_t thread1, pthread_t thread2)
97{
98 return thread1 == thread2;
99}
100
101#ifdef __cplusplus
102}
103#endif
104
#define NORETURN
The NORETURN keyword tells the compiler to assume that the function cannot return.
Common macros and compiler attributes/pragmas configuration.
int pthread_detach(pthread_t th)
Make a pthread unjoinable.
int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Spawn a new POSIX thread.
static int pthread_equal(pthread_t thread1, pthread_t thread2)
Compared two pthread identifiers.
pthread_t pthread_self(void)
Returns the pthread id of the calling/current thread.
void pthread_exit(void *retval) NORETURN
Exit calling pthread.
int pthread_join(pthread_t th, void **thread_return)
Join a pthread.
unsigned pthread_t
Datatype to identify a POSIX thread.
An attribute set to supply to pthread_create()