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
4a184a59
Commit
4a184a59
authored
Mar 30, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add ThreadScheduler::RegisterShutdownEvent implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a80f9a86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
scheduler.c
dlls/msvcrt/scheduler.c
+36
-1
No files found.
dlls/msvcrt/scheduler.c
View file @
4a184a59
...
...
@@ -114,6 +114,10 @@ typedef struct {
unsigned
int
id
;
unsigned
int
virt_proc_no
;
SchedulerPolicy
policy
;
int
shutdown_count
;
int
shutdown_size
;
HANDLE
*
shutdown_events
;
CRITICAL_SECTION
cs
;
}
ThreadScheduler
;
extern
const
vtable_ptr
MSVCRT_ThreadScheduler_vtable
;
...
...
@@ -522,8 +526,17 @@ void __thiscall SchedulerPolicy_dtor(SchedulerPolicy *this)
static
void
ThreadScheduler_dtor
(
ThreadScheduler
*
this
)
{
int
i
;
if
(
this
->
ref
!=
0
)
WARN
(
"ref = %d
\n
"
,
this
->
ref
);
SchedulerPolicy_dtor
(
&
this
->
policy
);
for
(
i
=
0
;
i
<
this
->
shutdown_count
;
i
++
)
SetEvent
(
this
->
shutdown_events
[
i
]);
MSVCRT_operator_delete
(
this
->
shutdown_events
);
this
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
this
->
cs
);
}
DEFINE_THISCALL_WRAPPER
(
ThreadScheduler_Id
,
4
)
...
...
@@ -572,7 +585,23 @@ unsigned int __thiscall ThreadScheduler_Release(ThreadScheduler *this)
DEFINE_THISCALL_WRAPPER
(
ThreadScheduler_RegisterShutdownEvent
,
8
)
void
__thiscall
ThreadScheduler_RegisterShutdownEvent
(
ThreadScheduler
*
this
,
HANDLE
event
)
{
FIXME
(
"(%p %p) stub
\n
"
,
this
,
event
);
HANDLE
*
shutdown_events
;
int
size
;
TRACE
(
"(%p %p)
\n
"
,
this
,
event
);
EnterCriticalSection
(
&
this
->
cs
);
size
=
this
->
shutdown_size
?
this
->
shutdown_size
*
2
:
1
;
shutdown_events
=
MSVCRT_operator_new
(
size
*
sizeof
(
*
shutdown_events
));
memcpy
(
shutdown_events
,
this
->
shutdown_events
,
this
->
shutdown_count
*
sizeof
(
*
shutdown_events
));
MSVCRT_operator_delete
(
this
->
shutdown_events
);
this
->
shutdown_size
=
size
;
this
->
shutdown_events
=
shutdown_events
;
this
->
shutdown_events
[
this
->
shutdown_count
++
]
=
event
;
LeaveCriticalSection
(
&
this
->
cs
);
}
DEFINE_THISCALL_WRAPPER
(
ThreadScheduler_Attach
,
4
)
...
...
@@ -654,6 +683,12 @@ static ThreadScheduler* ThreadScheduler_ctor(ThreadScheduler *this,
this
->
virt_proc_no
=
SchedulerPolicy_GetPolicyValue
(
&
this
->
policy
,
MaxConcurrency
);
if
(
this
->
virt_proc_no
>
si
.
dwNumberOfProcessors
)
this
->
virt_proc_no
=
si
.
dwNumberOfProcessors
;
this
->
shutdown_count
=
this
->
shutdown_size
=
0
;
this
->
shutdown_events
=
NULL
;
InitializeCriticalSection
(
&
this
->
cs
);
this
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": ThreadScheduler"
);
return
this
;
}
...
...
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