Class ThreadPool
public class ThreadPool
- Inheritance
-
ThreadPool
- Inherited Members
Methods
Free(ThreadPoolHandle, bool, bool)
Calls native method g_thread_pool_free.
public static extern void Free(ThreadPoolHandle pool, bool immediate, bool wait)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
immediate
boolTransfer ownership: None Nullable: False
wait
boolTransfer ownership: None Nullable: False
GetMaxIdleTime()
Calls native function g_thread_pool_get_max_idle_time. Version: 2.10
[Version("2.10")]
public static extern uint GetMaxIdleTime()
Returns
- uint
Transfer ownership: None Nullable: False
GetMaxThreads(ThreadPoolHandle)
Calls native method g_thread_pool_get_max_threads.
public static extern int GetMaxThreads(ThreadPoolHandle pool)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
Returns
- int
Transfer ownership: None Nullable: False
GetMaxUnusedThreads()
Calls native function g_thread_pool_get_max_unused_threads.
public static extern int GetMaxUnusedThreads()
Returns
- int
Transfer ownership: None Nullable: False
GetNumThreads(ThreadPoolHandle)
Calls native method g_thread_pool_get_num_threads.
public static extern uint GetNumThreads(ThreadPoolHandle pool)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
Returns
- uint
Transfer ownership: None Nullable: False
GetNumUnusedThreads()
Calls native function g_thread_pool_get_num_unused_threads.
public static extern uint GetNumUnusedThreads()
Returns
- uint
Transfer ownership: None Nullable: False
MoveToFront(ThreadPoolHandle, nint)
Calls native method g_thread_pool_move_to_front. Version: 2.46
[Version("2.46")]
public static extern bool MoveToFront(ThreadPoolHandle pool, nint data)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
data
nintTransfer ownership: None Nullable: True
Returns
- bool
Transfer ownership: None Nullable: False
New(Func, nint, int, bool, out ErrorOwnedHandle)
Calls native function g_thread_pool_new.
public static extern ThreadPoolUnownedHandle New(Func func, nint userData, int maxThreads, bool exclusive, out ErrorOwnedHandle error)
Parameters
func
FuncTransfer ownership: None Nullable: False
userData
nintTransfer ownership: None Nullable: True
maxThreads
intTransfer ownership: None Nullable: False
exclusive
boolTransfer ownership: None Nullable: False
error
ErrorOwnedHandle
Returns
- ThreadPoolUnownedHandle
Transfer ownership: None Nullable: False
NewFull(Func, nint, DestroyNotify, int, bool, out ErrorOwnedHandle)
Calls native function g_thread_pool_new_full. Version: 2.70
[Version("2.70")]
public static extern ThreadPoolOwnedHandle NewFull(Func func, nint userData, DestroyNotify itemFreeFunc, int maxThreads, bool exclusive, out ErrorOwnedHandle error)
Parameters
func
FuncTransfer ownership: None Nullable: False
userData
nintTransfer ownership: None Nullable: True
itemFreeFunc
DestroyNotifyTransfer ownership: None Nullable: True
maxThreads
intTransfer ownership: None Nullable: False
exclusive
boolTransfer ownership: None Nullable: False
error
ErrorOwnedHandle
Returns
- ThreadPoolOwnedHandle
Transfer ownership: Full Nullable: False
Push(ThreadPoolHandle, nint, out ErrorOwnedHandle)
Calls native method g_thread_pool_push.
public static extern bool Push(ThreadPoolHandle pool, nint data, out ErrorOwnedHandle error)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
data
nintTransfer ownership: None Nullable: True
error
ErrorOwnedHandle
Returns
- bool
Transfer ownership: None Nullable: False
SetMaxIdleTime(uint)
Calls native function g_thread_pool_set_max_idle_time. Version: 2.10
[Version("2.10")]
public static extern void SetMaxIdleTime(uint interval)
Parameters
interval
uintTransfer ownership: None Nullable: False
SetMaxThreads(ThreadPoolHandle, int, out ErrorOwnedHandle)
Calls native method g_thread_pool_set_max_threads.
public static extern bool SetMaxThreads(ThreadPoolHandle pool, int maxThreads, out ErrorOwnedHandle error)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
maxThreads
intTransfer ownership: None Nullable: False
error
ErrorOwnedHandle
Returns
- bool
Transfer ownership: None Nullable: False
SetMaxUnusedThreads(int)
Calls native function g_thread_pool_set_max_unused_threads.
public static extern void SetMaxUnusedThreads(int maxThreads)
Parameters
maxThreads
intTransfer ownership: None Nullable: False
SetSortFunction(ThreadPoolHandle, CompareDataFunc, nint)
Calls native method g_thread_pool_set_sort_function. Version: 2.10
[Version("2.10")]
public static extern void SetSortFunction(ThreadPoolHandle pool, CompareDataFunc func, nint userData)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
func
CompareDataFuncTransfer ownership: None Nullable: False
userData
nintTransfer ownership: None Nullable: True
StopUnusedThreads()
Calls native function g_thread_pool_stop_unused_threads.
public static extern void StopUnusedThreads()
Unprocessed(ThreadPoolHandle)
Calls native method g_thread_pool_unprocessed.
public static extern uint Unprocessed(ThreadPoolHandle pool)
Parameters
pool
ThreadPoolHandleTransfer ownership: None Nullable: False
Returns
- uint
Transfer ownership: None Nullable: False