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
0c91600e
Commit
0c91600e
authored
Feb 05, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtworkq: Add RtwqAllocateWorkQueue().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
be452914
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
2 deletions
+63
-2
queue.c
dlls/rtworkq/queue.c
+59
-0
rtworkq.spec
dlls/rtworkq/rtworkq.spec
+2
-2
rtworkq.idl
include/rtworkq.idl
+2
-0
No files found.
dlls/rtworkq/queue.c
View file @
0c91600e
...
...
@@ -54,6 +54,8 @@ struct queue_handle
static
struct
queue_handle
user_queues
[
MAX_USER_QUEUE_HANDLES
];
static
struct
queue_handle
*
next_free_user_queue
;
static
struct
queue_handle
*
next_unused_user_queue
=
user_queues
;
static
WORD
queue_generation
;
static
CRITICAL_SECTION
queues_section
;
static
CRITICAL_SECTION_DEBUG
queues_critsect_debug
=
...
...
@@ -559,6 +561,49 @@ 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
)
{
struct
queue_handle
*
entry
;
struct
queue
*
queue
;
unsigned
int
idx
;
*
queue_id
=
RTWQ_CALLBACK_QUEUE_UNDEFINED
;
if
(
platform_lock
<=
0
)
return
RTWQ_E_SHUTDOWN
;
queue
=
heap_alloc_zero
(
sizeof
(
*
queue
));
if
(
!
queue
)
return
E_OUTOFMEMORY
;
init_work_queue
(
queue_type
,
queue
);
EnterCriticalSection
(
&
queues_section
);
entry
=
next_free_user_queue
;
if
(
entry
)
next_free_user_queue
=
entry
->
obj
;
else
if
(
next_unused_user_queue
<
user_queues
+
MAX_USER_QUEUE_HANDLES
)
entry
=
next_unused_user_queue
++
;
else
{
LeaveCriticalSection
(
&
queues_section
);
heap_free
(
queue
);
WARN
(
"Out of user queue handles.
\n
"
);
return
E_OUTOFMEMORY
;
}
entry
->
refcount
=
1
;
entry
->
obj
=
queue
;
if
(
++
queue_generation
==
0xffff
)
queue_generation
=
1
;
entry
->
generation
=
queue_generation
;
idx
=
entry
-
user_queues
+
FIRST_USER_QUEUE_HANDLE
;
*
queue_id
=
(
idx
<<
16
)
|
entry
->
generation
;
LeaveCriticalSection
(
&
queues_section
);
return
S_OK
;
}
struct
async_result
{
RTWQASYNCRESULT
result
;
...
...
@@ -999,6 +1044,20 @@ HRESULT WINAPI RtwqInvokeCallback(IRtwqAsyncResult *result)
return
invoke_async_callback
(
result
);
}
HRESULT
WINAPI
RtwqPutWorkItem
(
DWORD
queue
,
LONG
priority
,
IRtwqAsyncResult
*
result
)
{
TRACE
(
"%d, %d, %p.
\n
"
,
queue
,
priority
,
result
);
return
queue_put_work_item
(
queue
,
priority
,
result
);
}
HRESULT
WINAPI
RtwqAllocateWorkQueue
(
RTWQ_WORKQUEUE_TYPE
queue_type
,
DWORD
*
queue
)
{
TRACE
(
"%d, %p.
\n
"
,
queue_type
,
queue
);
return
alloc_user_queue
(
queue_type
,
queue
);
}
HRESULT
WINAPI
RtwqLockWorkQueue
(
DWORD
queue
)
{
TRACE
(
"%#x.
\n
"
,
queue
);
...
...
dlls/rtworkq/rtworkq.spec
View file @
0c91600e
@ stdcall RtwqAddPeriodicCallback(ptr ptr ptr)
@ stub RtwqAllocateSerialWorkQueue
@ st
ub RtwqAllocateWorkQueue
@ st
dcall RtwqAllocateWorkQueue(long ptr)
@ stub RtwqBeginRegisterWorkQueueWithMMCSS
@ stub RtwqBeginUnregisterWorkQueueWithMMCSS
@ stub RtwqCancelDeadline
...
...
@@ -20,7 +20,7 @@
@ stdcall RtwqLockWorkQueue(long)
@ stub RtwqPutMultipleWaitingWorkItem
@ stdcall RtwqPutWaitingWorkItem(long long ptr ptr)
@ st
ub RtwqPutWorkItem
@ st
dcall RtwqPutWorkItem(long long ptr)
@ stub RtwqRegisterPlatformEvents
@ stub RtwqRegisterPlatformWithMMCSS
@ stdcall RtwqRemovePeriodicCallback(long)
...
...
include/rtworkq.idl
View file @
0c91600e
...
...
@@ -78,12 +78,14 @@ cpp_quote("} RTWQASYNCRESULT;")
cpp_quote
(
"typedef void (WINAPI *RTWQPERIODICCALLBACK)(IUnknown *context);"
)
cpp_quote
(
"HRESULT WINAPI RtwqAddPeriodicCallback(RTWQPERIODICCALLBACK callback, IUnknown *context, DWORD *key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqAllocateWorkQueue(RTWQ_WORKQUEUE_TYPE queue_type, DWORD *queue);"
)
cpp_quote
(
"HRESULT WINAPI RtwqCancelWorkItem(RTWQWORKITEM_KEY key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqCreateAsyncResult(IUnknown *object, IRtwqAsyncCallback *callback, IUnknown *state, IRtwqAsyncResult **result);"
)
cpp_quote
(
"HRESULT WINAPI RtwqInvokeCallback(IRtwqAsyncResult *result);"
)
cpp_quote
(
"HRESULT WINAPI RtwqLockPlatform(void);"
)
cpp_quote
(
"HRESULT WINAPI RtwqLockWorkQueue(DWORD queue);"
)
cpp_quote
(
"HRESULT WINAPI RtwqPutWaitingWorkItem(HANDLE event, LONG priority, IRtwqAsyncResult *result, RTWQWORKITEM_KEY *key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqPutWorkItem(DWORD queue, LONG priority, IRtwqAsyncResult *result);"
)
cpp_quote
(
"HRESULT WINAPI RtwqRemovePeriodicCallback(DWORD key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqScheduleWorkItem(IRtwqAsyncResult *result, INT64 timeout, RTWQWORKITEM_KEY *key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqShutdown(void);"
)
...
...
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