#include "objfw-defs.h"
#include "platform.h"
import "OFObject.h"
Go to the source code of this file.
|
static OF_INLINE OFPlainThread | OFCurrentPlainThread (void) |
| Returns the current plain thread.
|
|
static OF_INLINE bool | OFPlainThreadIsCurrent (OFPlainThread thread) |
| Returns whether the specified plain thread is the current thread.
|
|
int | OFPlainThreadAttributesInit (OFPlainThreadAttributes *attr) |
| Initializes the specified thread attributes.
|
|
int | OFPlainThreadNew (OFPlainThread *thread, const char *name, void(*function)(id), id object, const OFPlainThreadAttributes *attr) |
| Creates a new plain thread.
|
|
void | OFSetThreadName (const char *name) |
| Sets the name of the current thread.
|
|
int | OFPlainThreadJoin (OFPlainThread thread) |
| Joins the specified thread.
|
|
int | OFPlainThreadDetach (OFPlainThread thread) |
| Detaches the specified thread.
|
|
◆ OFCurrentPlainThread()
static OF_INLINE OFPlainThread OFCurrentPlainThread |
( |
void | | ) |
|
|
static |
Returns the current plain thread.
- Returns
- The current plain thread
◆ OFPlainThreadAttributesInit()
int OFPlainThreadAttributesInit |
( |
OFPlainThreadAttributes * | attr | ) |
|
|
extern |
Initializes the specified thread attributes.
- Parameters
-
attr | A pointer to the thread attributes to initialize |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainThreadDetach()
int OFPlainThreadDetach |
( |
OFPlainThread | thread | ) |
|
|
extern |
Detaches the specified thread.
- Parameters
-
thread | The thread to detach |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainThreadIsCurrent()
static OF_INLINE bool OFPlainThreadIsCurrent |
( |
OFPlainThread | thread | ) |
|
|
static |
Returns whether the specified plain thread is the current thread.
- Parameters
-
thread | The thread to check |
- Returns
- Whether the specified plain thread is the current thread
◆ OFPlainThreadJoin()
int OFPlainThreadJoin |
( |
OFPlainThread | thread | ) |
|
|
extern |
Joins the specified thread.
- Parameters
-
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFPlainThreadNew()
int OFPlainThreadNew |
( |
OFPlainThread * | thread, |
|
|
const char * | name, |
|
|
void(* | function )(id), |
|
|
id | object, |
|
|
const OFPlainThreadAttributes * | attr ) |
|
extern |
Creates a new plain thread.
A plain thread is similar to OFThread, but does not use exceptions and is just a lightweight wrapper around the system's thread implementation.
- Parameters
-
thread | A pointer to the thread to create |
name | A name for the thread |
function | The function the thread should execute |
object | The object to pass to the thread as an argument |
attr | Thread attributes |
- Returns
- 0 on success, or an error number from
<errno.h>
on error
◆ OFSetThreadName()
void OFSetThreadName |
( |
const char * | name | ) |
|
|
extern |
Sets the name of the current thread.
- Parameters
-
name | The name for the current thread |