Table of Contents

Class ThreadPool

Namespace
GLib.Internal
Assembly
GLib-2.0.dll
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 ThreadPoolHandle

Transfer ownership: None Nullable: False

immediate bool

Transfer ownership: None Nullable: False

wait bool

Transfer 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 ThreadPoolHandle

Transfer 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 ThreadPoolHandle

Transfer 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, IntPtr)

Calls native method g_thread_pool_move_to_front. Version: 2.46

[Version("2.46")]
public static extern bool MoveToFront(ThreadPoolHandle pool, IntPtr data)

Parameters

pool ThreadPoolHandle

Transfer ownership: None Nullable: False

data IntPtr

Transfer ownership: None Nullable: True

Returns

bool

Transfer ownership: None Nullable: False

New(Func, IntPtr, int, bool, out ErrorOwnedHandle)

Calls native function g_thread_pool_new.

public static extern ThreadPoolUnownedHandle New(Func func, IntPtr userData, int maxThreads, bool exclusive, out ErrorOwnedHandle error)

Parameters

func Func

Transfer ownership: None Nullable: False

userData IntPtr

Transfer ownership: None Nullable: True

maxThreads int

Transfer ownership: None Nullable: False

exclusive bool

Transfer ownership: None Nullable: False

error ErrorOwnedHandle

Returns

ThreadPoolUnownedHandle

Transfer ownership: None Nullable: False

NewFull(Func, IntPtr, 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, IntPtr userData, DestroyNotify itemFreeFunc, int maxThreads, bool exclusive, out ErrorOwnedHandle error)

Parameters

func Func

Transfer ownership: None Nullable: False

userData IntPtr

Transfer ownership: None Nullable: True

itemFreeFunc DestroyNotify

Transfer ownership: None Nullable: True

maxThreads int

Transfer ownership: None Nullable: False

exclusive bool

Transfer ownership: None Nullable: False

error ErrorOwnedHandle

Returns

ThreadPoolOwnedHandle

Transfer ownership: Full Nullable: False

Push(ThreadPoolHandle, IntPtr, out ErrorOwnedHandle)

Calls native method g_thread_pool_push.

public static extern bool Push(ThreadPoolHandle pool, IntPtr data, out ErrorOwnedHandle error)

Parameters

pool ThreadPoolHandle

Transfer ownership: None Nullable: False

data IntPtr

Transfer 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 uint

Transfer 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 ThreadPoolHandle

Transfer ownership: None Nullable: False

maxThreads int

Transfer 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 int

Transfer ownership: None Nullable: False

SetSortFunction(ThreadPoolHandle, CompareDataFunc, IntPtr)

Calls native method g_thread_pool_set_sort_function. Version: 2.10

[Version("2.10")]
public static extern void SetSortFunction(ThreadPoolHandle pool, CompareDataFunc func, IntPtr userData)

Parameters

pool ThreadPoolHandle

Transfer ownership: None Nullable: False

func CompareDataFunc

Transfer ownership: None Nullable: False

userData IntPtr

Transfer 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 ThreadPoolHandle

Transfer ownership: None Nullable: False

Returns

uint

Transfer ownership: None Nullable: False