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
5f72ec06
Commit
5f72ec06
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: Attach context to default scheduler on creation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b2eab1a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
cxx.h
dlls/msvcrt/cxx.h
+1
-0
scheduler.c
dlls/msvcrt/scheduler.c
+9
-1
No files found.
dlls/msvcrt/cxx.h
View file @
5f72ec06
...
@@ -267,6 +267,7 @@ typedef struct
...
@@ -267,6 +267,7 @@ typedef struct
extern
void
*
vtbl_wrapper_0
;
extern
void
*
vtbl_wrapper_0
;
extern
void
*
vtbl_wrapper_4
;
extern
void
*
vtbl_wrapper_4
;
extern
void
*
vtbl_wrapper_8
;
extern
void
*
vtbl_wrapper_8
;
extern
void
*
vtbl_wrapper_16
;
extern
void
*
vtbl_wrapper_20
;
extern
void
*
vtbl_wrapper_20
;
extern
void
*
vtbl_wrapper_28
;
extern
void
*
vtbl_wrapper_28
;
...
...
dlls/msvcrt/scheduler.c
View file @
5f72ec06
...
@@ -49,6 +49,7 @@ static int scheduler_id = -1;
...
@@ -49,6 +49,7 @@ static int scheduler_id = -1;
DEFINE_VTBL_WRAPPER
(
0
);
DEFINE_VTBL_WRAPPER
(
0
);
DEFINE_VTBL_WRAPPER
(
4
);
DEFINE_VTBL_WRAPPER
(
4
);
DEFINE_VTBL_WRAPPER
(
8
);
DEFINE_VTBL_WRAPPER
(
8
);
DEFINE_VTBL_WRAPPER
(
16
);
DEFINE_VTBL_WRAPPER
(
20
);
DEFINE_VTBL_WRAPPER
(
20
);
DEFINE_VTBL_WRAPPER
(
28
);
DEFINE_VTBL_WRAPPER
(
28
);
...
@@ -114,6 +115,7 @@ static void ExternalContextBase_ctor(ExternalContextBase*);
...
@@ -114,6 +115,7 @@ static void ExternalContextBase_ctor(ExternalContextBase*);
typedef
struct
Scheduler
{
typedef
struct
Scheduler
{
const
vtable_ptr
*
vtable
;
const
vtable_ptr
*
vtable
;
}
Scheduler
;
}
Scheduler
;
#define call_Scheduler_Reference(this) CALL_VTBL_FUNC(this, 16, unsigned int, (Scheduler*), (this))
#define call_Scheduler_Release(this) CALL_VTBL_FUNC(this, 20, unsigned int, (Scheduler*), (this))
#define call_Scheduler_Release(this) CALL_VTBL_FUNC(this, 20, unsigned int, (Scheduler*), (this))
#define call_Scheduler_Attach(this) CALL_VTBL_FUNC(this, 28, void, (Scheduler*), (this))
#define call_Scheduler_Attach(this) CALL_VTBL_FUNC(this, 28, void, (Scheduler*), (this))
...
@@ -143,6 +145,8 @@ static CRITICAL_SECTION default_scheduler_cs = { &default_scheduler_cs_debug, -1
...
@@ -143,6 +145,8 @@ static CRITICAL_SECTION default_scheduler_cs = { &default_scheduler_cs_debug, -1
static
SchedulerPolicy
default_scheduler_policy
;
static
SchedulerPolicy
default_scheduler_policy
;
static
ThreadScheduler
*
default_scheduler
;
static
ThreadScheduler
*
default_scheduler
;
static
void
create_default_scheduler
(
void
);
static
Context
*
try_get_current_context
(
void
)
static
Context
*
try_get_current_context
(
void
)
{
{
if
(
context_tls_index
==
TLS_OUT_OF_INDEXES
)
if
(
context_tls_index
==
TLS_OUT_OF_INDEXES
)
...
@@ -325,6 +329,10 @@ static void ExternalContextBase_ctor(ExternalContextBase *this)
...
@@ -325,6 +329,10 @@ static void ExternalContextBase_ctor(ExternalContextBase *this)
memset
(
this
,
0
,
sizeof
(
*
this
));
memset
(
this
,
0
,
sizeof
(
*
this
));
this
->
context
.
vtable
=
&
MSVCRT_ExternalContextBase_vtable
;
this
->
context
.
vtable
=
&
MSVCRT_ExternalContextBase_vtable
;
this
->
id
=
InterlockedIncrement
(
&
context_id
);
this
->
id
=
InterlockedIncrement
(
&
context_id
);
create_default_scheduler
();
this
->
scheduler
.
scheduler
=
&
default_scheduler
->
scheduler
;
call_Scheduler_Reference
(
&
default_scheduler
->
scheduler
);
}
}
/* ?Alloc@Concurrency@@YAPAXI@Z */
/* ?Alloc@Concurrency@@YAPAXI@Z */
...
@@ -834,7 +842,7 @@ Scheduler* __cdecl CurrentScheduler_Get(void)
...
@@ -834,7 +842,7 @@ Scheduler* __cdecl CurrentScheduler_Get(void)
create_default_scheduler
();
create_default_scheduler
();
context
->
scheduler
.
scheduler
=
&
default_scheduler
->
scheduler
;
context
->
scheduler
.
scheduler
=
&
default_scheduler
->
scheduler
;
ThreadScheduler_Reference
(
default_
scheduler
);
call_Scheduler_Reference
(
&
default_scheduler
->
scheduler
);
return
&
default_scheduler
->
scheduler
;
return
&
default_scheduler
->
scheduler
;
}
}
...
...
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