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
51388af0
Commit
51388af0
authored
May 31, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr100: Use Context to store critical_section owner.
parent
6e238142
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
msvcp140.c
dlls/msvcp140/tests/msvcp140.c
+1
-1
msvcp90.h
dlls/msvcp90/msvcp90.h
+1
-1
msvcr120.c
dlls/msvcr120/tests/msvcr120.c
+1
-1
concurrency.c
dlls/msvcrt/concurrency.c
+7
-7
No files found.
dlls/msvcp140/tests/msvcp140.c
View file @
51388af0
...
...
@@ -150,6 +150,7 @@ typedef struct
typedef
struct
cs_queue
{
void
*
ctx
;
struct
cs_queue
*
next
;
BOOL
free
;
int
unknown
;
...
...
@@ -157,7 +158,6 @@ typedef struct cs_queue
typedef
struct
{
ULONG_PTR
unk_thread_id
;
cs_queue
unk_active
;
void
*
unknown
[
2
];
cs_queue
*
head
;
...
...
dlls/msvcp90/msvcp90.h
View file @
51388af0
...
...
@@ -45,6 +45,7 @@ extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
/* keep in sync with msvcrt/lock.c */
typedef
struct
cs_queue
{
void
*
ctx
;
struct
cs_queue
*
next
;
BOOL
free
;
int
unknown
;
...
...
@@ -52,7 +53,6 @@ typedef struct cs_queue
typedef
struct
{
ULONG_PTR
unk_thread_id
;
cs_queue
unk_active
;
void
*
unknown
[
2
];
cs_queue
*
head
;
...
...
dlls/msvcr120/tests/msvcr120.c
View file @
51388af0
...
...
@@ -90,6 +90,7 @@ typedef unsigned char MSVCRT_bool;
typedef
struct
cs_queue
{
void
*
ctx
;
struct
cs_queue
*
next
;
BOOL
free
;
int
unknown
;
...
...
@@ -97,7 +98,6 @@ typedef struct cs_queue
typedef
struct
{
ULONG_PTR
unk_thread_id
;
cs_queue
unk_active
;
void
*
unknown
[
2
];
cs_queue
*
head
;
...
...
dlls/msvcrt/concurrency.c
View file @
51388af0
...
...
@@ -216,6 +216,7 @@ struct scheduled_chore {
/* keep in sync with msvcp90/msvcp90.h */
typedef
struct
cs_queue
{
Context
*
ctx
;
struct
cs_queue
*
next
;
#if _MSVCR_VER >= 110
LONG
free
;
...
...
@@ -225,7 +226,6 @@ typedef struct cs_queue
typedef
struct
{
ULONG_PTR
unk_thread_id
;
cs_queue
unk_active
;
#if _MSVCR_VER >= 110
void
*
unknown
[
2
];
...
...
@@ -2425,7 +2425,7 @@ critical_section* __thiscall critical_section_ctor(critical_section *this)
NtClose
(
event
);
}
this
->
unk_
thread_id
=
0
;
this
->
unk_
active
.
ctx
=
NULL
;
this
->
head
=
this
->
tail
=
NULL
;
return
this
;
}
...
...
@@ -2458,7 +2458,7 @@ static inline void spin_wait_for_next_cs(cs_queue *q)
static
inline
void
cs_set_head
(
critical_section
*
cs
,
cs_queue
*
q
)
{
cs
->
unk_
thread_id
=
GetCurrentThreadId
();
cs
->
unk_
active
.
ctx
=
get_current_context
();
cs
->
unk_active
.
next
=
q
->
next
;
cs
->
head
=
&
cs
->
unk_active
;
}
...
...
@@ -2467,7 +2467,7 @@ static inline void cs_lock(critical_section *cs, cs_queue *q)
{
cs_queue
*
last
;
if
(
cs
->
unk_
thread_id
==
GetCurrentThreadId
())
{
if
(
cs
->
unk_
active
.
ctx
==
get_current_context
())
{
improper_lock
e
;
improper_lock_ctor_str
(
&
e
,
"Already locked"
);
_CxxThrowException
(
&
e
,
&
improper_lock_exception_type
);
...
...
@@ -2507,7 +2507,7 @@ bool __thiscall critical_section_try_lock(critical_section *this)
TRACE
(
"(%p)
\n
"
,
this
);
if
(
this
->
unk_
thread_id
==
GetCurrentThreadId
())
if
(
this
->
unk_
active
.
ctx
==
get_current_context
())
return
FALSE
;
memset
(
&
q
,
0
,
sizeof
(
q
));
...
...
@@ -2529,7 +2529,7 @@ void __thiscall critical_section_unlock(critical_section *this)
{
TRACE
(
"(%p)
\n
"
,
this
);
this
->
unk_
thread_id
=
0
;
this
->
unk_
active
.
ctx
=
NULL
;
this
->
head
=
NULL
;
if
(
InterlockedCompareExchangePointer
(
&
this
->
tail
,
NULL
,
&
this
->
unk_active
)
==
&
this
->
unk_active
)
return
;
...
...
@@ -2577,7 +2577,7 @@ bool __thiscall critical_section_try_lock_for(
TRACE
(
"(%p %d)
\n
"
,
this
,
timeout
);
if
(
this
->
unk_
thread_id
==
GetCurrentThreadId
())
{
if
(
this
->
unk_
active
.
ctx
==
get_current_context
())
{
improper_lock
e
;
improper_lock_ctor_str
(
&
e
,
"Already locked"
);
_CxxThrowException
(
&
e
,
&
improper_lock_exception_type
);
...
...
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