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 
57 
74 kFx(kStatus) kThreadPool_BeginExecute(kThreadPool pool, kThreadFx entryFx, kPointer context, kThreadPoolTransaction* transaction);
75 
91 kFx(kStatus) kThreadPool_EndExecute(kThreadPool pool, kThreadPoolTransaction transaction, k64u timeout, kStatus* status);
92 
109 
110 #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.
kSize kThreadPool_Count(kThreadPool pool)
Returns the number of threads in the pool.
Core Zen type declarations.
kStatus kThreadPool_Construct(kThreadPool *pool, kSize threadCount, kAlloc allocator)
Constructs a kThreadPool object.
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.
kStatus kThreadPool_BeginExecute(kThreadPool pool, kThreadFx entryFx, kPointer context, kThreadPoolTransaction *transaction)
Schedules the specified callback for execution on the thread pool.
kStatus kThreadPool_EndExecute(kThreadPool pool, kThreadPoolTransaction transaction, k64u timeout, kStatus *status)
Blocks until execution of a thread pool transaction is complete.