Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b8805c1e
Commit
b8805c1e
authored
Feb 11, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtworkq: Add a structure for queue initialization parameters.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
570c969e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
queue.c
dlls/rtworkq/queue.c
+24
-8
No files found.
dlls/rtworkq/queue.c
View file @
b8805c1e
...
...
@@ -136,6 +136,11 @@ static const TP_CALLBACK_PRIORITY priorities[] =
TP_CALLBACK_PRIORITY_LOW
,
};
struct
queue_desc
{
RTWQ_WORKQUEUE_TYPE
queue_type
;
};
struct
queue
{
TP_POOL
*
pool
;
...
...
@@ -228,7 +233,7 @@ static struct work_item * alloc_work_item(struct queue *queue, LONG priority, IR
return
item
;
}
static
void
init_work_queue
(
RTWQ_WORKQUEUE_TYPE
queue_type
,
struct
queue
*
queue
)
static
void
init_work_queue
(
const
struct
queue_desc
*
desc
,
struct
queue
*
queue
)
{
TP_CALLBACK_ENVIRON_V3
env
;
unsigned
int
max_thread
,
i
;
...
...
@@ -250,12 +255,12 @@ static void init_work_queue(RTWQ_WORKQUEUE_TYPE queue_type, struct queue *queue)
list_init
(
&
queue
->
pending_items
);
InitializeCriticalSection
(
&
queue
->
cs
);
max_thread
=
(
queue_type
==
RTWQ_STANDARD_WORKQUEUE
||
queue_type
==
RTWQ_WINDOW_WORKQUEUE
)
?
1
:
4
;
max_thread
=
(
desc
->
queue_type
==
RTWQ_STANDARD_WORKQUEUE
||
desc
->
queue_type
==
RTWQ_WINDOW_WORKQUEUE
)
?
1
:
4
;
SetThreadpoolThreadMinimum
(
queue
->
pool
,
1
);
SetThreadpoolThreadMaximum
(
queue
->
pool
,
max_thread
);
if
(
queue_type
==
RTWQ_WINDOW_WORKQUEUE
)
if
(
desc
->
queue_type
==
RTWQ_WINDOW_WORKQUEUE
)
FIXME
(
"RTWQ_WINDOW_WORKQUEUE is not supported.
\n
"
);
}
...
...
@@ -277,6 +282,8 @@ static HRESULT grab_queue(DWORD queue_id, struct queue **ret)
}
else
if
(
queue
)
{
struct
queue_desc
desc
;
EnterCriticalSection
(
&
queues_section
);
switch
(
queue_id
)
{
...
...
@@ -288,7 +295,9 @@ static HRESULT grab_queue(DWORD queue_id, struct queue **ret)
default:
queue_type
=
RTWQ_STANDARD_WORKQUEUE
;
}
init_work_queue
(
queue_type
,
queue
);
desc
.
queue_type
=
queue_type
;
init_work_queue
(
&
desc
,
queue
);
LeaveCriticalSection
(
&
queues_section
);
*
ret
=
queue
;
return
S_OK
;
...
...
@@ -604,7 +613,7 @@ static HRESULT queue_cancel_item(struct queue *queue, RTWQWORKITEM_KEY key)
return
hr
;
}
static
HRESULT
alloc_user_queue
(
RTWQ_WORKQUEUE_TYPE
queue_type
,
DWORD
*
queue_id
)
static
HRESULT
alloc_user_queue
(
const
struct
queue_desc
*
desc
,
DWORD
*
queue_id
)
{
struct
queue_handle
*
entry
;
struct
queue
*
queue
;
...
...
@@ -618,7 +627,8 @@ static HRESULT alloc_user_queue(RTWQ_WORKQUEUE_TYPE queue_type, DWORD *queue_id)
queue
=
heap_alloc_zero
(
sizeof
(
*
queue
));
if
(
!
queue
)
return
E_OUTOFMEMORY
;
init_work_queue
(
queue_type
,
queue
);
init_work_queue
(
desc
,
queue
);
EnterCriticalSection
(
&
queues_section
);
...
...
@@ -839,6 +849,8 @@ HRESULT WINAPI RtwqUnlockPlatform(void)
static
void
init_system_queues
(
void
)
{
struct
queue_desc
desc
;
/* Always initialize standard queue, keep the rest lazy. */
EnterCriticalSection
(
&
queues_section
);
...
...
@@ -849,7 +861,8 @@ static void init_system_queues(void)
return
;
}
init_work_queue
(
RTWQ_STANDARD_WORKQUEUE
,
&
system_queues
[
SYS_QUEUE_STANDARD
]);
desc
.
queue_type
=
RTWQ_STANDARD_WORKQUEUE
;
init_work_queue
(
&
desc
,
&
system_queues
[
SYS_QUEUE_STANDARD
]);
LeaveCriticalSection
(
&
queues_section
);
}
...
...
@@ -1096,9 +1109,12 @@ HRESULT WINAPI RtwqPutWorkItem(DWORD queue, LONG priority, IRtwqAsyncResult *res
HRESULT
WINAPI
RtwqAllocateWorkQueue
(
RTWQ_WORKQUEUE_TYPE
queue_type
,
DWORD
*
queue
)
{
struct
queue_desc
desc
;
TRACE
(
"%d, %p.
\n
"
,
queue_type
,
queue
);
return
alloc_user_queue
(
queue_type
,
queue
);
desc
.
queue_type
=
queue_type
;
return
alloc_user_queue
(
&
desc
,
queue
);
}
HRESULT
WINAPI
RtwqLockWorkQueue
(
DWORD
queue
)
...
...
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