Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kThreadPool.h
Go to the documentation of this file.
1 
10 #ifndef K_API_THREADPOOL_H
11 #define K_API_THREADPOOL_H
12 
13 #include <kApi/kApiDef.h>
14 #include <kApi/Threads/kThread.h>
15 #include <kApi/Threads/kThreadPool.x.h>
16 
27 //typedef kObject kThreadPool; --forward-declared in kFsDef.x.h
28 
35 
45 kFx(kStatus) kThreadPool_Construct(kThreadPool* pool, kSize threadCount, kAlloc allocator);
46 
59 kFx(kStatus) kThreadPool_SetPriority(kThreadPool pool, kThreadPriorityClass priorityClass, k32s priorityOffset);
60 
73 
84 
101 kFx(kStatus) kThreadPool_BeginExecute(kThreadPool pool, kThreadFx entryFx, kPointer context, kThreadPoolTransaction* transaction);
102 
118 kFx(kStatus) kThreadPool_EndExecute(kThreadPool pool, kThreadPoolTransaction transaction, k64u timeout, kStatus* status);
119 
136 
137 #endif
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.
kThreadPool kThreadPool_Default()
Returns the default thread pool.
Opaque pointer to a kThreadPool transaction.
Represents a 1D array of bits.
kSize kThreadPool_Count(kThreadPool pool)
Returns the number of threads in the pool.
kStatus kThreadPool_SetAffinity(kThreadPool pool, kBitArray affinity)
Sets the CPUs with which the thread pool should have affinity.
Core Zen type declarations.
kStatus kThreadPool_Construct(kThreadPool *pool, kSize threadCount, kAlloc allocator)
Constructs a kThreadPool object.
Represents a 32-bit signed integer.
Represents a thread pool.
kStatus(kCall * kThreadFx)(kPointer context)
Thread entry-point signature; used by kThread_Start.
Definition: kThread.h:16
Declares the kThread class.
Represents an error code.
Represents a thread priority class.
kStatus kThreadPool_BeginExecute(kThreadPool pool, kThreadFx entryFx, kPointer context, kThreadPoolTransaction *transaction)
Schedules the specified callback for execution on the thread pool.
kStatus kThreadPool_SetPriority(kThreadPool pool, kThreadPriorityClass priorityClass, k32s priorityOffset)
Sets the priority associated with the thread pool.
kStatus kThreadPool_EndExecute(kThreadPool pool, kThreadPoolTransaction transaction, k64u timeout, kStatus *status)
Blocks until execution of a thread pool transaction is complete.