#include <sys/types.h>
Go to the source code of this file.
◆ pthread_create()
int pthread_create |
( |
pthread_t *restrict |
thread, |
|
|
const pthread_attr_t *restrict |
attr, |
|
|
void *(*)(void *) |
start_routine, |
|
|
void *restrict |
arg |
|
) |
| |
Create a thread in the current process
- Parameters
-
thread | A pointer to a pthread_t where the created thread will be placed |
attr | Either a pointer to a thread attribute structure, or NULL, in which case the default attributes will be used |
start_routine | The start function of the thread |
arg | An arhument to the start function |
- Returns
- 0 if creation was sucsessful, 1 otherwise
◆ pthread_exit()
void pthread_exit |
( |
void * |
value_ptr | ) |
|
Terminate the current thread
- Parameters
-
value_ptr | A pointer that when other threads in the process join on the current thread, they will recieve. (not implemented) |
◆ pthread_spin_destroy()
Destroys a spin lock
- Parameters
-
lock | The spinlock to destroy |
- Returns
- 0 on success, 1 on failure
◆ pthread_spin_init()
Initializes a spin lock
- Parameters
-
lock | The spinlock to initialize |
pshared | Unused |
- Returns
- 0 on success, 1 on failure
◆ pthread_spin_lock()
Locks a spin lock
- Parameters
-
- Returns
- 0 on success, 1 on failure
◆ pthread_spin_unlock()
Unlocks a spin lock
- Parameters
-
lock | The spinlock to unlock |
- Returns
- 0 on success, 1 on failure