|
Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <Thread.h>
POSIX Threads.
Asynchronous computing via multiple threads of execution.
Properties | |
| ident | data |
| The user data. More... | |
| ThreadFunction | function |
| The Thread function. More... | |
| _Bool | isCancelled |
true when this Thread has been cancelled, false otherwise. More... | |
| _Bool | isDetached |
true when this Thread has been detached, false otherwise. More... | |
| _Bool | isExecuting |
true when this Thread is executing, false otherwise. More... | |
| _Bool | isFinished |
true when this Thread is finished, false otherwise. More... | |
| Object | object |
| The superclass. More... | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. More... | |
Methods | |
| Class * | _Thread (void) |
| The Thread archetype. More... | |
| void | cancel (Thread *self) |
| Cancel this Thread from another Thread. More... | |
| Thread * | currentThread (void) |
| Returns the currently executing Thread. More... | |
| void | detach (Thread *self) |
| Daemonize this Thread. More... | |
| Thread * | init (Thread *self) |
| Initializes this Thread. More... | |
| Thread * | initWithFunction (Thread *self, ThreadFunction function, ident data) |
| Initializes this Thread with the specified ThreadFunction and data. More... | |
| void | join (Thread *self, ident *status) |
| Wait for the specified Thread to terminate. More... | |
| void | kill (Thread *self, int signal) |
| Sends the given signal to this Thread. More... | |
| void | start (Thread *self) |
| Start this Thread. More... | |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. More... | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. More... | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. More... | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. More... | |
| _Bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. More... | |
| _Bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. More... | |
Protected Attributes | |
| ThreadInterface * | interface |
| The interface. More... | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. More... | |
| ThreadFunction Thread::function |
| _Bool Thread::isCancelled |
| _Bool Thread::isDetached |
| _Bool Thread::isExecuting |
| _Bool Thread::isFinished |
| Class * _Thread | ( | void | ) |
The Thread archetype.
Definition at line 205 of file Thread.c.
| void cancel | ( | Thread * | self | ) |
Cancel this Thread from another Thread.
| self | The Thread. |
Definition at line 64 of file Thread.c.
| Thread * currentThread | ( | void | ) |
| void detach | ( | Thread * | self | ) |
Daemonize this Thread.
| self | The Thread. |
Definition at line 89 of file Thread.c.
Initializes this Thread.
| self | The Thread. |
NULL on error. Definition at line 103 of file Thread.c.
| Thread * initWithFunction | ( | Thread * | self, |
| ThreadFunction | function, | ||
| ident | data | ||
| ) |
Initializes this Thread with the specified ThreadFunction and data.
| self | The Thread. |
| function | The ThreadFunction to run. |
| data | The user data. |
NULL on error. Definition at line 112 of file Thread.c.
Wait for the specified Thread to terminate.
| self | The Thread. |
| status | If not NULL, the return value of this Thread's ThreadFunction is returned here. |
Definition at line 130 of file Thread.c.
| void kill | ( | Thread * | self, |
| int | signal | ||
| ) |
| void start | ( | Thread * | self | ) |
Start this Thread.
| self | The Thread. |
Definition at line 168 of file Thread.c.