|
ReactOS 0.4.16-dev-1946-g52006dd
|
#include <assert.h>#include <stdarg.h>#include <limits.h>#include "ntstatus.h"#include "winternl.h"#include "wine/debug.h"#include "wine/list.h"#include "ntdll_misc.h"
Go to the source code of this file.
Classes | |
| struct | rtl_work_item |
| struct | queue_timer |
| struct | timer_queue |
| struct | threadpool |
| struct | io_completion |
| struct | threadpool_object |
| struct | threadpool_instance |
| struct | threadpool_group |
| struct | waitqueue_bucket |
Macros | |
| #define | WIN32_NO_STATUS |
| #define | EXPIRE_NEVER (~(ULONGLONG)0) |
| #define | TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ |
| #define | THREADPOOL_WORKER_TIMEOUT 5000 |
| #define | MAXIMUM_WAITQUEUE_OBJECTS (MAXIMUM_WAIT_OBJECTS - 1) |
Enumerations | |
| enum | threadpool_objtype { TP_OBJECT_TYPE_SIMPLE , TP_OBJECT_TYPE_WORK , TP_OBJECT_TYPE_TIMER , TP_OBJECT_TYPE_WAIT , TP_OBJECT_TYPE_IO } |
Variables | |
| static RTL_CRITICAL_SECTION_DEBUG | critsect_compl_debug |
| struct { | |
| HANDLE compl_port | |
| RTL_CRITICAL_SECTION threadpool_compl_cs | |
| } | old_threadpool |
| static RTL_CRITICAL_SECTION_DEBUG | timerqueue_debug |
| struct { | |
| CRITICAL_SECTION cs | |
| LONG objcount | |
| BOOL thread_running | |
| struct list pending_timers | |
| RTL_CONDITION_VARIABLE update_event | |
| } | timerqueue |
| static RTL_CRITICAL_SECTION_DEBUG | waitqueue_debug |
| struct { | |
| CRITICAL_SECTION cs | |
| LONG num_buckets | |
| struct list buckets | |
| } | waitqueue |
| static RTL_CRITICAL_SECTION_DEBUG | ioqueue_debug |
| struct { | |
| CRITICAL_SECTION cs | |
| LONG objcount | |
| BOOL thread_running | |
| HANDLE port | |
| RTL_CONDITION_VARIABLE update_event | |
| } | ioqueue |
| static struct threadpool * | default_threadpool = NULL |
Definition at line 79 of file threadpool.c.
| #define MAXIMUM_WAITQUEUE_OBJECTS (MAXIMUM_WAIT_OBJECTS - 1) |
Definition at line 140 of file threadpool.c.
| #define THREADPOOL_WORKER_TIMEOUT 5000 |
Definition at line 139 of file threadpool.c.
| #define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ |
Definition at line 80 of file threadpool.c.
| #define WIN32_NO_STATUS |
Definition at line 58 of file threadpool.c.
| Enumerator | |
|---|---|
| TP_OBJECT_TYPE_SIMPLE | |
| TP_OBJECT_TYPE_WORK | |
| TP_OBJECT_TYPE_TIMER | |
| TP_OBJECT_TYPE_WAIT | |
| TP_OBJECT_TYPE_IO | |
Definition at line 161 of file threadpool.c.
|
static |
Definition at line 441 of file threadpool.c.
Referenced by ioqueue_thread_proc().
|
inlinestatic |
Definition at line 627 of file threadpool.c.
Referenced by RtlRegisterWait(), and timer_queue_thread_proc().
|
static |
Definition at line 954 of file threadpool.c.
Referenced by RtlCreateTimer().
|
inlinestatic |
Definition at line 425 of file threadpool.c.
Referenced by TpCallbackLeaveCriticalSectionOnCompletion(), TpCallbackMayRunLong(), TpCallbackReleaseMutexOnCompletion(), TpCallbackReleaseSemaphoreOnCompletion(), TpCallbackSetEventOnCompletion(), TpCallbackUnloadDllOnCompletion(), and TpDisassociateCallback().
|
inlinestatic |
Definition at line 420 of file threadpool.c.
Referenced by tp_object_initialize(), TpReleaseCleanupGroup(), and TpReleaseCleanupGroupMembers().
|
inlinestatic |
Definition at line 413 of file threadpool.c.
Referenced by TpCancelAsyncIoOperation(), TpReleaseIoCompletion(), TpStartAsyncIoOperation(), and TpWaitForIoCompletion().
|
inlinestatic |
Definition at line 387 of file threadpool.c.
Referenced by TpQueryPoolStackInformation(), TpReleasePool(), TpSetPoolMaxThreads(), TpSetPoolMinThreads(), and TpSetPoolStackInformation().
|
inlinestatic |
Definition at line 399 of file threadpool.c.
Referenced by TpIsTimerSet(), TpReleaseTimer(), TpSetTimer(), and TpWaitForTimer().
|
inlinestatic |
Definition at line 406 of file threadpool.c.
Referenced by rtl_wait_callback(), RtlRegisterWait(), TpReleaseWait(), TpSetWait(), and TpWaitForWait().
|
inlinestatic |
Definition at line 392 of file threadpool.c.
Referenced by TpPostWork(), TpReleaseWork(), and TpWaitForWork().
Definition at line 539 of file threadpool.c.
Referenced by RtlSetIoCompletionCallback().
Definition at line 1615 of file threadpool.c.
Referenced by tp_ioqueue_lock().
|
static |
Definition at line 2184 of file threadpool.c.
Referenced by tp_object_execute(), tp_object_wait(), TpCancelAsyncIoOperation(), and TpDisassociateCallback().
|
static |
Definition at line 479 of file threadpool.c.
Referenced by RtlQueueWorkItem().
|
static |
Definition at line 684 of file threadpool.c.
Referenced by queue_move_timer(), and RtlCreateTimer().
Definition at line 677 of file threadpool.c.
Referenced by queue_get_timeout(), queue_timer_expire(), RtlCreateTimer(), and RtlUpdateTimer().
|
static |
Definition at line 837 of file threadpool.c.
Referenced by RtlDeleteTimer(), and RtlDeleteTimerQueueEx().
|
static |
Definition at line 763 of file threadpool.c.
Referenced by timer_queue_thread_proc().
|
inlinestatic |
Definition at line 710 of file threadpool.c.
Referenced by queue_destroy_timer(), queue_timer_expire(), and RtlUpdateTimer().
|
static |
Definition at line 636 of file threadpool.c.
Referenced by queue_destroy_timer(), and timer_cleanup_callback().
|
static |
Definition at line 718 of file threadpool.c.
Referenced by timer_queue_thread_proc().
|
static |
Definition at line 3381 of file threadpool.c.
Referenced by RtlRegisterWait().
| NTSTATUS WINAPI RtlCreateTimer | ( | HANDLE | TimerQueue, |
| HANDLE * | NewTimer, | ||
| RTL_WAITORTIMERCALLBACKFUNC | Callback, | ||
| PVOID | Parameter, | ||
| DWORD | DueTime, | ||
| DWORD | Period, | ||
| ULONG | Flags | ||
| ) |
Definition at line 1003 of file threadpool.c.
Definition at line 864 of file threadpool.c.
Referenced by get_timer_queue().
Definition at line 1098 of file threadpool.c.
Definition at line 910 of file threadpool.c.
Referenced by get_timer_queue().
Definition at line 3499 of file threadpool.c.
Definition at line 3458 of file threadpool.c.
| NTSTATUS WINAPI RtlQueueWorkItem | ( | PRTL_WORK_ITEM_ROUTINE | function, |
| PVOID | context, | ||
| ULONG | flags | ||
| ) |
Definition at line 511 of file threadpool.c.
| NTSTATUS WINAPI RtlRegisterWait | ( | HANDLE * | out, |
| HANDLE | handle, | ||
| RTL_WAITORTIMERCALLBACKFUNC | callback, | ||
| void * | context, | ||
| ULONG | milliseconds, | ||
| ULONG | flags | ||
| ) |
Definition at line 3412 of file threadpool.c.
| NTSTATUS WINAPI RtlSetIoCompletionCallback | ( | HANDLE | FileHandle, |
| PRTL_OVERLAPPED_COMPLETION_ROUTINE | Function, | ||
| ULONG | Flags | ||
| ) |
Definition at line 589 of file threadpool.c.
Definition at line 1062 of file threadpool.c.
Definition at line 468 of file threadpool.c.
Referenced by ioqueue_thread_proc(), threadpool_worker_proc(), timer_queue_thread_proc(), timerqueue_thread_proc(), and waitqueue_thread_proc().
|
static |
Definition at line 2292 of file threadpool.c.
Referenced by threadpool_worker_proc().
Definition at line 2471 of file threadpool.c.
Referenced by tp_new_worker_thread().
Definition at line 669 of file threadpool.c.
Referenced by queue_timer_expire().
|
static |
Definition at line 655 of file threadpool.c.
Referenced by queue_timer_expire(), and timer_callback_wrapper().
Definition at line 788 of file threadpool.c.
Referenced by RtlCreateTimerQueue().
Definition at line 1144 of file threadpool.c.
Referenced by tp_timerqueue_lock().
|
static |
Definition at line 2638 of file threadpool.c.
Referenced by RtlRegisterWait(), and TpAllocWait().
|
static |
Definition at line 1960 of file threadpool.c.
Referenced by TpAllocCleanupGroup().
|
static |
Definition at line 2002 of file threadpool.c.
Referenced by tp_object_release(), and TpReleaseCleanupGroup().
|
static |
Definition at line 1992 of file threadpool.c.
Referenced by TpReleaseCleanupGroup().
|
static |
Definition at line 1724 of file threadpool.c.
Referenced by TpAllocIoCompletion().
|
static |
Definition at line 2218 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
|
static |
Definition at line 1242 of file threadpool.c.
Referenced by tp_object_submit(), tp_threadpool_lock(), TpCallbackMayRunLong(), and TpSetPoolMinThreads().
|
static |
Definition at line 2158 of file threadpool.c.
Referenced by TpReleaseCleanupGroupMembers(), TpWaitForIoCompletion(), TpWaitForTimer(), TpWaitForWait(), and TpWaitForWork().
|
static |
Definition at line 2312 of file threadpool.c.
Referenced by threadpool_worker_proc(), and waitqueue_thread_proc().
|
static |
Definition at line 2026 of file threadpool.c.
Referenced by tp_alloc_wait(), TpAllocIoCompletion(), TpAllocTimer(), TpAllocWork(), and TpSimpleTryPost().
|
static |
Definition at line 2237 of file threadpool.c.
Referenced by tp_object_execute(), TpReleaseCleanupGroupMembers(), TpReleaseIoCompletion(), TpReleaseTimer(), TpReleaseWait(), and TpReleaseWork().
|
static |
Definition at line 2107 of file threadpool.c.
Referenced by threadpool_worker_proc(), and tp_object_submit().
|
static |
Definition at line 2252 of file threadpool.c.
Referenced by ioqueue_thread_proc(), threadpool_worker_proc(), tp_object_cancel(), tp_object_initialize(), TpReleaseCleanupGroupMembers(), TpReleaseIoCompletion(), TpReleaseTimer(), TpReleaseWait(), TpReleaseWork(), and waitqueue_thread_proc().
|
static |
Definition at line 2119 of file threadpool.c.
Referenced by ioqueue_thread_proc(), timerqueue_thread_proc(), tp_object_initialize(), TpPostWork(), TpSetTimer(), and waitqueue_thread_proc().
|
static |
Definition at line 2203 of file threadpool.c.
Referenced by TpReleaseCleanupGroupMembers(), TpWaitForIoCompletion(), TpWaitForTimer(), TpWaitForWait(), and TpWaitForWork().
|
static |
Definition at line 1782 of file threadpool.c.
Referenced by tp_threadpool_lock(), and TpAllocPool().
|
static |
Definition at line 1874 of file threadpool.c.
Referenced by tp_alloc_wait(), TpAllocIoCompletion(), TpAllocTimer(), TpAllocWork(), and TpSimpleTryPost().
|
static |
Definition at line 1845 of file threadpool.c.
Referenced by threadpool_worker_proc(), tp_threadpool_lock(), tp_threadpool_unlock(), and TpReleasePool().
|
static |
Definition at line 1832 of file threadpool.c.
Referenced by tp_threadpool_lock(), and TpReleasePool().
|
static |
Definition at line 1947 of file threadpool.c.
Referenced by tp_alloc_wait(), tp_object_release(), TpAllocIoCompletion(), and TpAllocTimer().
|
static |
Definition at line 1265 of file threadpool.c.
Referenced by TpAllocTimer().
|
static |
Definition at line 1307 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
|
static |
Definition at line 1515 of file threadpool.c.
Referenced by tp_alloc_wait().
|
static |
Definition at line 1593 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
| NTSTATUS WINAPI TpAllocCleanupGroup | ( | TP_CLEANUP_GROUP ** | out | ) |
Definition at line 2534 of file threadpool.c.
Referenced by CreateThreadpoolCleanupGroup(), and init_threadpool().
| NTSTATUS WINAPI TpAllocIoCompletion | ( | TP_IO ** | out, |
| HANDLE | file, | ||
| PTP_IO_CALLBACK | callback, | ||
| void * | userdata, | ||
| TP_CALLBACK_ENVIRON * | environment | ||
| ) |
Definition at line 2544 of file threadpool.c.
Referenced by CreateThreadpoolIo(), and init_threadpool().
Definition at line 2588 of file threadpool.c.
Referenced by CreateThreadpool(), and init_threadpool().
| NTSTATUS WINAPI TpAllocTimer | ( | TP_TIMER ** | out, |
| PTP_TIMER_CALLBACK | callback, | ||
| PVOID | userdata, | ||
| TP_CALLBACK_ENVIRON * | environment | ||
| ) |
Definition at line 2601 of file threadpool.c.
Referenced by CreateThreadpoolTimer(), and init_threadpool().
| NTSTATUS WINAPI TpAllocWait | ( | TP_WAIT ** | out, |
| PTP_WAIT_CALLBACK | callback, | ||
| PVOID | userdata, | ||
| TP_CALLBACK_ENVIRON * | environment | ||
| ) |
Definition at line 2677 of file threadpool.c.
Referenced by CreateThreadpoolWait(), and init_threadpool().
| NTSTATUS WINAPI TpAllocWork | ( | TP_WORK ** | out, |
| PTP_WORK_CALLBACK | callback, | ||
| PVOID | userdata, | ||
| TP_CALLBACK_ENVIRON * | environment | ||
| ) |
Definition at line 2687 of file threadpool.c.
Referenced by CreateThreadpoolWork(), and init_threadpool().
| VOID WINAPI TpCallbackLeaveCriticalSectionOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
| CRITICAL_SECTION * | crit | ||
| ) |
Definition at line 2740 of file threadpool.c.
| NTSTATUS WINAPI TpCallbackMayRunLong | ( | TP_CALLBACK_INSTANCE * | instance | ) |
Definition at line 2753 of file threadpool.c.
Referenced by CallbackMayRunLong(), and init_threadpool().
| VOID WINAPI TpCallbackReleaseMutexOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
| HANDLE | mutex | ||
| ) |
Definition at line 2795 of file threadpool.c.
| VOID WINAPI TpCallbackReleaseSemaphoreOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
| HANDLE | semaphore, | ||
| DWORD | count | ||
| ) |
Definition at line 2808 of file threadpool.c.
Referenced by init_threadpool().
| VOID WINAPI TpCallbackSetEventOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
| HANDLE | event | ||
| ) |
Definition at line 2824 of file threadpool.c.
| VOID WINAPI TpCallbackUnloadDllOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
| HMODULE | module | ||
| ) |
Definition at line 2837 of file threadpool.c.
Definition at line 2718 of file threadpool.c.
Referenced by init_threadpool().
| VOID WINAPI TpDisassociateCallback | ( | TP_CALLBACK_INSTANCE * | instance | ) |
Definition at line 2850 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2881 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2893 of file threadpool.c.
Referenced by init_threadpool().
| NTSTATUS WINAPI TpQueryPoolStackInformation | ( | TP_POOL * | pool, |
| TP_POOL_STACK_INFORMATION * | stack_info | ||
| ) |
Definition at line 3364 of file threadpool.c.
Referenced by init_threadpool(), and QueryThreadpoolStackInformation().
| VOID WINAPI TpReleaseCleanupGroup | ( | TP_CLEANUP_GROUP * | group | ) |
Definition at line 2905 of file threadpool.c.
Referenced by init_threadpool().
| VOID WINAPI TpReleaseCleanupGroupMembers | ( | TP_CLEANUP_GROUP * | group, |
| BOOL | cancel_pending, | ||
| PVOID | userdata | ||
| ) |
Definition at line 2918 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2991 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3014 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3027 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3041 of file threadpool.c.
Referenced by init_threadpool(), and RtlDeregisterWaitEx().
Definition at line 3055 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3069 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3084 of file threadpool.c.
| NTSTATUS WINAPI TpSetPoolStackInformation | ( | TP_POOL * | pool, |
| TP_POOL_STACK_INFORMATION * | stack_info | ||
| ) |
Definition at line 3345 of file threadpool.c.
Referenced by init_threadpool(), and SetThreadpoolStackInformation().
| VOID WINAPI TpSetTimer | ( | TP_TIMER * | timer, |
| LARGE_INTEGER * | timeout, | ||
| LONG | period, | ||
| LONG | window_length | ||
| ) |
Definition at line 3113 of file threadpool.c.
Referenced by init_threadpool().
| VOID WINAPI TpSetWait | ( | TP_WAIT * | wait, |
| HANDLE | handle, | ||
| LARGE_INTEGER * | timeout | ||
| ) |
Definition at line 3191 of file threadpool.c.
Referenced by init_threadpool(), RtlDeregisterWaitEx(), and RtlRegisterWait().
| NTSTATUS WINAPI TpSimpleTryPost | ( | PTP_SIMPLE_CALLBACK | callback, |
| PVOID | userdata, | ||
| TP_CALLBACK_ENVIRON * | environment | ||
| ) |
Definition at line 3243 of file threadpool.c.
Referenced by init_threadpool(), RtlQueueWorkItem(), and TrySubmitThreadpoolCallback().
Definition at line 3273 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3289 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3303 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3317 of file threadpool.c.
Referenced by init_threadpool(), and RtlDeregisterWaitEx().
Definition at line 3331 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 1339 of file threadpool.c.
Referenced by tp_waitqueue_lock().
| WINE_DEFAULT_DEBUG_CHANNEL | ( | threadpool | ) |
Definition at line 324 of file threadpool.c.
Referenced by add_hash(), delete_hash_entry(), hash_lookup(), and new_hash().
| HANDLE compl_port |
Definition at line 88 of file threadpool.c.
|
static |
Definition at line 83 of file threadpool.c.
Definition at line 285 of file threadpool.c.
Referenced by TpQueryPoolStackInformation(), TpReleaseCleanupGroupMembers(), TpSetPoolMaxThreads(), TpSetPoolMinThreads(), and TpSetPoolStackInformation().
|
static |
Definition at line 439 of file threadpool.c.
Referenced by tp_threadpool_lock(), and tp_threadpool_shutdown().
| struct { ... } ioqueue |
Referenced by ioqueue_thread_proc(), tp_ioqueue_lock(), and tp_ioqueue_unlock().
|
static |
Definition at line 358 of file threadpool.c.
| LONG num_buckets |
Definition at line 323 of file threadpool.c.
Referenced by hash_table_hash(), and hash_table_init().
| LONG objcount |
Definition at line 286 of file threadpool.c.
| struct { ... } old_threadpool |
Referenced by RtlSetIoCompletionCallback().
Definition at line 288 of file threadpool.c.
| HANDLE port |
Definition at line 366 of file threadpool.c.
| BOOL thread_running |
Definition at line 287 of file threadpool.c.
| RTL_CRITICAL_SECTION threadpool_compl_cs |
Definition at line 89 of file threadpool.c.
| struct { ... } timerqueue |
Referenced by timerqueue_thread_proc(), tp_timerqueue_lock(), tp_timerqueue_unlock(), and TpSetTimer().
|
static |
Definition at line 280 of file threadpool.c.
| RTL_CONDITION_VARIABLE update_event |
Definition at line 289 of file threadpool.c.
| struct { ... } waitqueue |
Referenced by RtlRegisterWait(), tp_object_execute(), tp_waitqueue_lock(), tp_waitqueue_unlock(), TpSetWait(), and waitqueue_thread_proc().
|
static |
Definition at line 317 of file threadpool.c.