Objectively
Object oriented framework for C.
Loading...
Searching...
No Matches
Thread.h File Reference

POSIX Threads. More...

Go to the source code of this file.

Data Structures

struct  Thread
 POSIX Threads. More...
 

Typedefs

typedef ident(* ThreadFunction) (Thread *thread)
 The function type for Thread execution.
 

Functions

OBJECTIVELY_EXPORT Class * _Thread (void)
 

Detailed Description

POSIX Threads.

Definition in file Thread.h.

Typedef Documentation

◆ ThreadFunction

typedef ident(* ThreadFunction) (Thread *thread)

The function type for Thread execution.

Parameters
threadThe executing Thread.

Definition at line 45 of file Thread.h.

Function Documentation

◆ _Thread()

OBJECTIVELY_EXPORT Class * _Thread ( void  )

Definition at line 215 of file Thread.c.

215 {
216 static Class *clazz;
217 static Once once;
218
219 do_once(&once, {
220 clazz = _initialize(&(const ClassDef) {
221 .name = "Thread",
222 .superclass = _Object(),
223 .instanceSize = sizeof(Thread),
224 .interfaceSize = sizeof(ThreadInterface),
225 .initialize = initialize,
226 });
227 });
228
229 return clazz;
230}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:151
Class * _Object(void)
Definition Object.c:136
static void initialize(Class *clazz)
Definition Thread.c:195
long Once
The Once type.
Definition Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition Class.h:41
The runtime representation of a Class.
Definition Class.h:90
POSIX Threads.
Definition Thread.h:53