ReactOS 0.4.16-dev-983-g23ad936
|
#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 84 of file threadpool.c.
#define MAXIMUM_WAITQUEUE_OBJECTS (MAXIMUM_WAIT_OBJECTS - 1) |
Definition at line 145 of file threadpool.c.
#define THREADPOOL_WORKER_TIMEOUT 5000 |
Definition at line 144 of file threadpool.c.
#define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ |
Definition at line 85 of file threadpool.c.
#define WIN32_NO_STATUS |
Definition at line 63 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 166 of file threadpool.c.
|
static |
Definition at line 446 of file threadpool.c.
Referenced by ioqueue_thread_proc().
|
inlinestatic |
Definition at line 632 of file threadpool.c.
Referenced by RtlRegisterWait(), and timer_queue_thread_proc().
|
static |
Definition at line 957 of file threadpool.c.
Referenced by RtlCreateTimer().
|
inlinestatic |
Definition at line 430 of file threadpool.c.
Referenced by TpCallbackLeaveCriticalSectionOnCompletion(), TpCallbackMayRunLong(), TpCallbackReleaseMutexOnCompletion(), TpCallbackReleaseSemaphoreOnCompletion(), TpCallbackSetEventOnCompletion(), TpCallbackUnloadDllOnCompletion(), and TpDisassociateCallback().
|
inlinestatic |
Definition at line 425 of file threadpool.c.
Referenced by tp_object_initialize(), TpReleaseCleanupGroup(), and TpReleaseCleanupGroupMembers().
|
inlinestatic |
Definition at line 418 of file threadpool.c.
Referenced by TpCancelAsyncIoOperation(), TpReleaseIoCompletion(), TpStartAsyncIoOperation(), and TpWaitForIoCompletion().
|
inlinestatic |
Definition at line 392 of file threadpool.c.
Referenced by TpQueryPoolStackInformation(), TpReleasePool(), TpSetPoolMaxThreads(), TpSetPoolMinThreads(), and TpSetPoolStackInformation().
|
inlinestatic |
Definition at line 404 of file threadpool.c.
Referenced by TpIsTimerSet(), TpReleaseTimer(), TpSetTimer(), and TpWaitForTimer().
|
inlinestatic |
Definition at line 411 of file threadpool.c.
Referenced by rtl_wait_callback(), RtlRegisterWait(), TpReleaseWait(), TpSetWait(), and TpWaitForWait().
|
inlinestatic |
Definition at line 397 of file threadpool.c.
Referenced by TpPostWork(), TpReleaseWork(), and TpWaitForWork().
Definition at line 544 of file threadpool.c.
Referenced by RtlSetIoCompletionCallback().
Definition at line 1618 of file threadpool.c.
Referenced by tp_ioqueue_lock().
|
static |
Definition at line 2187 of file threadpool.c.
Referenced by tp_object_execute(), tp_object_wait(), TpCancelAsyncIoOperation(), and TpDisassociateCallback().
|
static |
Definition at line 484 of file threadpool.c.
Referenced by RtlQueueWorkItem().
|
static |
Definition at line 689 of file threadpool.c.
Referenced by queue_move_timer(), and RtlCreateTimer().
Definition at line 682 of file threadpool.c.
Referenced by queue_get_timeout(), queue_timer_expire(), RtlCreateTimer(), and RtlUpdateTimer().
|
static |
Definition at line 840 of file threadpool.c.
Referenced by RtlDeleteTimer(), and RtlDeleteTimerQueueEx().
|
static |
Definition at line 768 of file threadpool.c.
Referenced by timer_queue_thread_proc().
|
inlinestatic |
Definition at line 715 of file threadpool.c.
Referenced by queue_destroy_timer(), queue_timer_expire(), and RtlUpdateTimer().
|
static |
Definition at line 641 of file threadpool.c.
Referenced by queue_destroy_timer(), and timer_cleanup_callback().
|
static |
Definition at line 723 of file threadpool.c.
Referenced by timer_queue_thread_proc().
|
static |
Definition at line 3383 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 1006 of file threadpool.c.
Definition at line 867 of file threadpool.c.
Referenced by BasepCreateDefaultTimerQueue(), CreateTimerQueue(), and get_timer_queue().
Definition at line 1101 of file threadpool.c.
Definition at line 913 of file threadpool.c.
Referenced by get_timer_queue().
Definition at line 3501 of file threadpool.c.
Definition at line 3460 of file threadpool.c.
NTSTATUS WINAPI RtlQueueWorkItem | ( | PRTL_WORK_ITEM_ROUTINE | function, |
PVOID | context, | ||
ULONG | flags | ||
) |
Definition at line 516 of file threadpool.c.
NTSTATUS WINAPI RtlRegisterWait | ( | HANDLE * | out, |
HANDLE | handle, | ||
RTL_WAITORTIMERCALLBACKFUNC | callback, | ||
void * | context, | ||
ULONG | milliseconds, | ||
ULONG | flags | ||
) |
Definition at line 3414 of file threadpool.c.
NTSTATUS WINAPI RtlSetIoCompletionCallback | ( | HANDLE | FileHandle, |
PRTL_OVERLAPPED_COMPLETION_ROUTINE | Function, | ||
ULONG | Flags | ||
) |
Definition at line 594 of file threadpool.c.
Definition at line 1065 of file threadpool.c.
Definition at line 473 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 2295 of file threadpool.c.
Referenced by threadpool_worker_proc().
Definition at line 2474 of file threadpool.c.
Referenced by tp_new_worker_thread().
Definition at line 674 of file threadpool.c.
Referenced by queue_timer_expire().
|
static |
Definition at line 660 of file threadpool.c.
Referenced by queue_timer_expire(), and timer_callback_wrapper().
Definition at line 793 of file threadpool.c.
Referenced by RtlCreateTimerQueue().
Definition at line 1147 of file threadpool.c.
Referenced by tp_timerqueue_lock().
|
static |
Definition at line 2641 of file threadpool.c.
Referenced by RtlRegisterWait(), and TpAllocWait().
|
static |
Definition at line 1963 of file threadpool.c.
Referenced by TpAllocCleanupGroup().
|
static |
Definition at line 2005 of file threadpool.c.
Referenced by tp_object_release(), and TpReleaseCleanupGroup().
|
static |
Definition at line 1995 of file threadpool.c.
Referenced by TpReleaseCleanupGroup().
|
static |
Definition at line 1727 of file threadpool.c.
Referenced by TpAllocIoCompletion().
|
static |
Definition at line 2221 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
|
static |
Definition at line 1245 of file threadpool.c.
Referenced by tp_object_submit(), tp_threadpool_lock(), TpCallbackMayRunLong(), and TpSetPoolMinThreads().
|
static |
Definition at line 2161 of file threadpool.c.
Referenced by TpReleaseCleanupGroupMembers(), TpWaitForIoCompletion(), TpWaitForTimer(), TpWaitForWait(), and TpWaitForWork().
|
static |
Definition at line 2315 of file threadpool.c.
Referenced by threadpool_worker_proc(), and waitqueue_thread_proc().
|
static |
Definition at line 2029 of file threadpool.c.
Referenced by tp_alloc_wait(), TpAllocIoCompletion(), TpAllocTimer(), TpAllocWork(), and TpSimpleTryPost().
|
static |
Definition at line 2240 of file threadpool.c.
Referenced by tp_object_execute(), TpReleaseCleanupGroupMembers(), TpReleaseIoCompletion(), TpReleaseTimer(), TpReleaseWait(), and TpReleaseWork().
|
static |
Definition at line 2110 of file threadpool.c.
Referenced by threadpool_worker_proc(), and tp_object_submit().
|
static |
Definition at line 2255 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 2122 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 2206 of file threadpool.c.
Referenced by TpReleaseCleanupGroupMembers(), TpWaitForIoCompletion(), TpWaitForTimer(), TpWaitForWait(), and TpWaitForWork().
|
static |
Definition at line 1785 of file threadpool.c.
Referenced by tp_threadpool_lock(), and TpAllocPool().
|
static |
Definition at line 1877 of file threadpool.c.
Referenced by tp_alloc_wait(), TpAllocIoCompletion(), TpAllocTimer(), TpAllocWork(), and TpSimpleTryPost().
|
static |
Definition at line 1848 of file threadpool.c.
Referenced by threadpool_worker_proc(), tp_threadpool_lock(), tp_threadpool_unlock(), and TpReleasePool().
|
static |
Definition at line 1835 of file threadpool.c.
Referenced by tp_threadpool_lock(), and TpReleasePool().
|
static |
Definition at line 1950 of file threadpool.c.
Referenced by tp_alloc_wait(), tp_object_release(), TpAllocIoCompletion(), and TpAllocTimer().
|
static |
Definition at line 1268 of file threadpool.c.
Referenced by TpAllocTimer().
|
static |
Definition at line 1310 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
|
static |
Definition at line 1518 of file threadpool.c.
Referenced by tp_alloc_wait().
|
static |
Definition at line 1596 of file threadpool.c.
Referenced by tp_object_prepare_shutdown().
NTSTATUS WINAPI TpAllocCleanupGroup | ( | TP_CLEANUP_GROUP ** | out | ) |
Definition at line 2537 of file threadpool.c.
Referenced by init_threadpool().
NTSTATUS WINAPI TpAllocIoCompletion | ( | TP_IO ** | out, |
HANDLE | file, | ||
PTP_IO_CALLBACK | callback, | ||
void * | userdata, | ||
TP_CALLBACK_ENVIRON * | environment | ||
) |
Definition at line 2547 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2591 of file threadpool.c.
Referenced by init_threadpool().
NTSTATUS WINAPI TpAllocTimer | ( | TP_TIMER ** | out, |
PTP_TIMER_CALLBACK | callback, | ||
PVOID | userdata, | ||
TP_CALLBACK_ENVIRON * | environment | ||
) |
Definition at line 2604 of file threadpool.c.
Referenced by init_threadpool().
NTSTATUS WINAPI TpAllocWait | ( | TP_WAIT ** | out, |
PTP_WAIT_CALLBACK | callback, | ||
PVOID | userdata, | ||
TP_CALLBACK_ENVIRON * | environment | ||
) |
NTSTATUS WINAPI TpAllocWork | ( | TP_WORK ** | out, |
PTP_WORK_CALLBACK | callback, | ||
PVOID | userdata, | ||
TP_CALLBACK_ENVIRON * | environment | ||
) |
Definition at line 2690 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpCallbackLeaveCriticalSectionOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
CRITICAL_SECTION * | crit | ||
) |
Definition at line 2743 of file threadpool.c.
NTSTATUS WINAPI TpCallbackMayRunLong | ( | TP_CALLBACK_INSTANCE * | instance | ) |
Definition at line 2756 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpCallbackReleaseMutexOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
HANDLE | mutex | ||
) |
Definition at line 2798 of file threadpool.c.
VOID WINAPI TpCallbackReleaseSemaphoreOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
HANDLE | semaphore, | ||
DWORD | count | ||
) |
Definition at line 2811 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpCallbackSetEventOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
HANDLE | event | ||
) |
Definition at line 2827 of file threadpool.c.
VOID WINAPI TpCallbackUnloadDllOnCompletion | ( | TP_CALLBACK_INSTANCE * | instance, |
HMODULE | module | ||
) |
Definition at line 2840 of file threadpool.c.
Definition at line 2721 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpDisassociateCallback | ( | TP_CALLBACK_INSTANCE * | instance | ) |
Definition at line 2853 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2884 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2896 of file threadpool.c.
Referenced by init_threadpool().
NTSTATUS WINAPI TpQueryPoolStackInformation | ( | TP_POOL * | pool, |
TP_POOL_STACK_INFORMATION * | stack_info | ||
) |
Definition at line 3367 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpReleaseCleanupGroup | ( | TP_CLEANUP_GROUP * | group | ) |
Definition at line 2908 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpReleaseCleanupGroupMembers | ( | TP_CLEANUP_GROUP * | group, |
BOOL | cancel_pending, | ||
PVOID | userdata | ||
) |
Definition at line 2921 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 2994 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3017 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3030 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3044 of file threadpool.c.
Referenced by init_threadpool(), and RtlDeregisterWaitEx().
Definition at line 3058 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3072 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3087 of file threadpool.c.
NTSTATUS WINAPI TpSetPoolStackInformation | ( | TP_POOL * | pool, |
TP_POOL_STACK_INFORMATION * | stack_info | ||
) |
Definition at line 3348 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpSetTimer | ( | TP_TIMER * | timer, |
LARGE_INTEGER * | timeout, | ||
LONG | period, | ||
LONG | window_length | ||
) |
Definition at line 3116 of file threadpool.c.
Referenced by init_threadpool().
VOID WINAPI TpSetWait | ( | TP_WAIT * | wait, |
HANDLE | handle, | ||
LARGE_INTEGER * | timeout | ||
) |
Definition at line 3194 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 3246 of file threadpool.c.
Referenced by init_threadpool(), and RtlQueueWorkItem().
Definition at line 3276 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3292 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3306 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 3320 of file threadpool.c.
Referenced by init_threadpool(), and RtlDeregisterWaitEx().
Definition at line 3334 of file threadpool.c.
Referenced by init_threadpool().
Definition at line 1342 of file threadpool.c.
Referenced by tp_waitqueue_lock().
WINE_DEFAULT_DEBUG_CHANNEL | ( | threadpool | ) |
Definition at line 329 of file threadpool.c.
Referenced by add_hash(), delete_hash_entry(), hash_lookup(), and new_hash().
HANDLE compl_port |
Definition at line 93 of file threadpool.c.
|
static |
Definition at line 88 of file threadpool.c.
Definition at line 290 of file threadpool.c.
Referenced by TpQueryPoolStackInformation(), TpReleaseCleanupGroupMembers(), TpSetPoolMaxThreads(), TpSetPoolMinThreads(), and TpSetPoolStackInformation().
|
static |
Definition at line 444 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 363 of file threadpool.c.
LONG num_buckets |
Definition at line 328 of file threadpool.c.
Referenced by hash_table_hash(), and hash_table_init().
LONG objcount |
Definition at line 291 of file threadpool.c.
struct { ... } old_threadpool |
Referenced by RtlSetIoCompletionCallback().
Definition at line 293 of file threadpool.c.
HANDLE port |
Definition at line 371 of file threadpool.c.
BOOL thread_running |
Definition at line 292 of file threadpool.c.
RTL_CRITICAL_SECTION threadpool_compl_cs |
Definition at line 94 of file threadpool.c.
struct { ... } timerqueue |
Referenced by timerqueue_thread_proc(), tp_timerqueue_lock(), tp_timerqueue_unlock(), and TpSetTimer().
|
static |
Definition at line 285 of file threadpool.c.
RTL_CONDITION_VARIABLE update_event |
Definition at line 294 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 322 of file threadpool.c.