Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
41b24f21
Commit
41b24f21
authored
Mar 11, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Mar 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move all structs and definitions to the beginning in threadpool.c.
parent
1d965de1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
45 deletions
+44
-45
threadpool.c
dlls/ntdll/threadpool.c
+44
-45
No files found.
dlls/ntdll/threadpool.c
View file @
41b24f21
...
...
@@ -37,7 +37,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
threadpool
);
#define WORKER_TIMEOUT 30000
/* 30 seconds */
#define OLD_WORKER_TIMEOUT 30000
/* 30 seconds */
#define EXPIRE_NEVER (~(ULONGLONG)0)
#define TIMER_QUEUE_MAGIC 0x516d6954
/* TimQ */
static
RTL_CRITICAL_SECTION_DEBUG
critsect_debug
;
static
RTL_CRITICAL_SECTION_DEBUG
critsect_compl_debug
;
...
...
@@ -87,6 +89,44 @@ struct work_item
PVOID
context
;
};
struct
wait_work_item
{
HANDLE
Object
;
HANDLE
CancelEvent
;
WAITORTIMERCALLBACK
Callback
;
PVOID
Context
;
ULONG
Milliseconds
;
ULONG
Flags
;
HANDLE
CompletionEvent
;
LONG
DeleteCount
;
BOOLEAN
CallbackInProgress
;
};
struct
timer_queue
;
struct
queue_timer
{
struct
timer_queue
*
q
;
struct
list
entry
;
ULONG
runcount
;
/* number of callbacks pending execution */
RTL_WAITORTIMERCALLBACKFUNC
callback
;
PVOID
param
;
DWORD
period
;
ULONG
flags
;
ULONGLONG
expire
;
BOOL
destroy
;
/* timer should be deleted; once set, never unset */
HANDLE
event
;
/* removal event */
};
struct
timer_queue
{
DWORD
magic
;
RTL_CRITICAL_SECTION
cs
;
struct
list
timers
;
/* sorted by expiration time */
BOOL
quit
;
/* queue should be deleted; once set, never unset */
HANDLE
event
;
HANDLE
thread
;
};
static
inline
LONG
interlocked_inc
(
PLONG
dest
)
{
return
interlocked_xchg_add
(
dest
,
1
)
+
1
;
...
...
@@ -102,7 +142,7 @@ static void WINAPI worker_thread_proc(void * param)
struct
list
*
item
;
struct
work_item
*
work_item_ptr
,
work_item
;
LARGE_INTEGER
timeout
;
timeout
.
QuadPart
=
-
(
WORKER_TIMEOUT
*
(
ULONGLONG
)
10000
);
timeout
.
QuadPart
=
-
(
OLD_
WORKER_TIMEOUT
*
(
ULONGLONG
)
10000
);
RtlEnterCriticalSection
(
&
old_threadpool
.
threadpool_cs
);
old_threadpool
.
num_workers
++
;
...
...
@@ -311,19 +351,6 @@ static inline PLARGE_INTEGER get_nt_timeout( PLARGE_INTEGER pTime, ULONG timeout
return
pTime
;
}
struct
wait_work_item
{
HANDLE
Object
;
HANDLE
CancelEvent
;
WAITORTIMERCALLBACK
Callback
;
PVOID
Context
;
ULONG
Milliseconds
;
ULONG
Flags
;
HANDLE
CompletionEvent
;
LONG
DeleteCount
;
BOOLEAN
CallbackInProgress
;
};
static
void
delete_wait_work_item
(
struct
wait_work_item
*
wait_work_item
)
{
NtClose
(
wait_work_item
->
CancelEvent
);
...
...
@@ -526,34 +553,6 @@ NTSTATUS WINAPI RtlDeregisterWait(HANDLE WaitHandle)
/************************** Timer Queue Impl **************************/
struct
timer_queue
;
struct
queue_timer
{
struct
timer_queue
*
q
;
struct
list
entry
;
ULONG
runcount
;
/* number of callbacks pending execution */
RTL_WAITORTIMERCALLBACKFUNC
callback
;
PVOID
param
;
DWORD
period
;
ULONG
flags
;
ULONGLONG
expire
;
BOOL
destroy
;
/* timer should be deleted; once set, never unset */
HANDLE
event
;
/* removal event */
};
struct
timer_queue
{
DWORD
magic
;
RTL_CRITICAL_SECTION
cs
;
struct
list
timers
;
/* sorted by expiration time */
BOOL
quit
;
/* queue should be deleted; once set, never unset */
HANDLE
event
;
HANDLE
thread
;
};
#define EXPIRE_NEVER (~(ULONGLONG) 0)
#define TIMER_QUEUE_MAGIC 0x516d6954
/* TimQ */
static
void
queue_remove_timer
(
struct
queue_timer
*
t
)
{
/* We MUST hold the queue cs while calling this function. This ensures
...
...
@@ -861,10 +860,10 @@ NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent)
return
status
;
}
static
struct
timer_queue
*
default_timer_queue
;
static
struct
timer_queue
*
get_timer_queue
(
HANDLE
TimerQueue
)
{
static
struct
timer_queue
*
default_timer_queue
;
if
(
TimerQueue
)
return
TimerQueue
;
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment