Zen API

- Home
- Topics
- Types
- Files

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
16 typedef kStatus(kCall* kThreadFx)(kPointer context);
17
18 #include <kApi/Threads/kThread.x.h>
19
26 //typedef kObject kThread; --forward-declared in kApiDef.x.h
27
34 kFx(kSize) kThread_ProcessorCount();
35
52 kFx(kStatus) kThread_Sleep(k64u duration);
53
64 kFx(kStatus) kThread_SleepAtLeast(k64u duration);
65
74 kFx(kStatus) kThread_Construct(kThread* thread, kAlloc allocator);
75
85 kFx(kStatus) kThread_Start(kThread thread, kThreadFx function, kPointer context);
86
101 kFx(kStatus) kThread_StartEx(kThread thread, kThreadFx function, kPointer context,
102 kSize stackSize, const kChar* name, k32s priority);
103
113 kFx(kStatus) kThread_Join(kThread thread, k64u timeout, kStatus* exitCode);
114
122 kFx(kBool) kThread_IsSelf(kThread other);
123
124 #endif
kThread::kThread_Start
kStatus kThread_Start(kThread thread, kThreadFx function, kPointer context)
Begins executing a thread using the specified callback function.
kThread::kThread_SleepAtLeast
kStatus kThread_SleepAtLeast(k64u duration)
Causes the current thread to yield control for at least the specified duration.
k64u
Represents a 64-bit unsigned integer.
kPointer
Represents a void pointer.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kThread::kThread_IsSelf
kBool kThread_IsSelf(kThread other)
Reports whether the specified thread is the currently executing thread.
kChar
Represents a single unit (byte) in a UTF-8 character.
kThread
Represents a thread.
kMsgQueueItemOption::kStatus
typedef kStatus(kCall *kMsgQueueDropFx)(kPointer receiver
Defines the signature of a callback function to handle dropped items.
kThread::kThread_Sleep
kStatus kThread_Sleep(k64u duration)
Causes the current thread to yield control for approximately the specified duration.
kThread::kThread_ProcessorCount
kSize kThread_ProcessorCount()
Reports the number of logical processors in the current system.
kThread::kThread_StartEx
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.
kApiDef.h
Core Zen type declarations.
k32s
Represents a 32-bit signed integer.
kThreadFx
kStatus(kCall * kThreadFx)(kPointer context)
Thread entry-point signature; used by kThread_Start.
Definition: kThread.h:16
kStatus
Represents an error code.
kCall
#define kCall
kApi standard function calling convention.
Definition: kApiDef.h:15
kThread::kThread_Join
kStatus kThread_Join(kThread thread, k64u timeout, kStatus *exitCode)
Blocks until the thread exits, or until a timeout occurs.
kThread::kThread_Construct
kStatus kThread_Construct(kThread *thread, kAlloc allocator)
Constructs a kThread object.
kBool
Represents a boolean value.