Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kThread.h
Go to the documentation of this file.
1 
10 #ifndef K_API_THREAD_H
11 #define K_API_THREAD_H
12 
13 #include <kApi/kApiDef.h>
14 
15 kBeginHeader()
16 
17 
18 typedef kStatus(kCall* kThreadFx)(kPointer context);
19 
26 //typedef kObject kThread; --forward-declared in kApiDef.x.h
27 
44 kFx(kStatus) kThread_Sleep(k64u duration);
45 
56 kFx(kStatus) kThread_SleepAtLeast(k64u duration);
57 
66 kFx(kStatus) kThread_Construct(kThread* thread, kAlloc allocator);
67 
77 kFx(kStatus) kThread_Start(kThread thread, kThreadFx function, kPointer context);
78 
93 kFx(kStatus) kThread_StartEx(kThread thread, kThreadFx function, kPointer context,
94  kSize stackSize, const kChar* name, k32s priority);
95 
105 kFx(kStatus) kThread_Join(kThread thread, k64u timeout, kStatus* exitCode);
106 
107 kEndHeader()
108 
109 #include <kApi/Threads/kThread.x.h>
110 
111 #endif
kStatus kThread_Start(kThread thread, kThreadFx function, kPointer context)
Begins executing a thread using the specified callback function.
kStatus kThread_SleepAtLeast(k64u duration)
Causes the current thread to yield control for at least the specified duration.
Represents a 64-bit unsigned integer.
Represents a void pointer.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
Represents a single unit (byte) in a UTF-8 character.
Represents a thread.
kStatus kThread_Sleep(k64u duration)
Causes the current thread to yield control for approximately the specified duration.
kStatus kThread_StartEx(kThread thread, kThreadFx function, kPointer context, kSize stackSize, const kChar *name, k32s priority)
Begins executing a thread using the specified callback function and options.
Core Zen type declarations.
Represents a 32-bit signed integer.
kStatus(kCall * kThreadFx)(kPointer context)
Thread entry-point signature; used by kThread_Start.
Definition: kThread.h:18
Represents an error code.
#define kCall
kApi standard function calling convention.
Definition: kApiDef.h:17
kStatus kThread_Join(kThread thread, k64u timeout, kStatus *exitCode)
Blocks until the thread exits, or until a timeout occurs.
kStatus kThread_Construct(kThread *thread, kAlloc allocator)
Constructs a kThread object.