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
3f55fb72
Commit
3f55fb72
authored
Aug 25, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr110: Add Context::IsCurrentTaskCollectionCanceling implementation.
parent
4ef31ae9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
8 deletions
+42
-8
concurrency.c
dlls/msvcrt/concurrency.c
+42
-8
No files found.
dlls/msvcrt/concurrency.c
View file @
3f55fb72
...
...
@@ -103,6 +103,7 @@ typedef struct {
unsigned
int
id
;
union
allocator_cache_entry
*
allocator_cache
[
8
];
LONG
blocked
;
struct
_StructuredTaskCollection
*
task_collection
;
}
ExternalContextBase
;
extern
const
vtable_ptr
ExternalContextBase_vtable
;
static
void
ExternalContextBase_ctor
(
ExternalContextBase
*
);
...
...
@@ -175,7 +176,7 @@ typedef struct
}
SpinWait
;
#define FINISHED_INITIAL 0x80000000
typedef
struct
typedef
struct
_StructuredTaskCollection
{
void
*
unk1
;
unsigned
int
unk2
;
...
...
@@ -187,6 +188,8 @@ typedef struct
void
*
event
;
}
_StructuredTaskCollection
;
bool
__thiscall
_StructuredTaskCollection__IsCanceling
(
_StructuredTaskCollection
*
);
typedef
enum
{
TASK_COLLECTION_SUCCESS
=
1
,
...
...
@@ -851,7 +854,17 @@ void __cdecl Context__SpinYield(void)
/* ?IsCurrentTaskCollectionCanceling@Context@Concurrency@@SA_NXZ */
bool
__cdecl
Context_IsCurrentTaskCollectionCanceling
(
void
)
{
FIXME
(
"()
\n
"
);
ExternalContextBase
*
ctx
=
(
ExternalContextBase
*
)
try_get_current_context
();
TRACE
(
"()
\n
"
);
if
(
ctx
&&
ctx
->
context
.
vtable
!=
&
ExternalContextBase_vtable
)
{
ERR
(
"unknown context set
\n
"
);
return
FALSE
;
}
if
(
ctx
&&
ctx
->
task_collection
)
return
_StructuredTaskCollection__IsCanceling
(
ctx
->
task_collection
);
return
FALSE
;
}
...
...
@@ -2166,23 +2179,44 @@ static LONG CALLBACK execute_chore_except(EXCEPTION_POINTERS *pexc, void *_data)
return
EXCEPTION_EXECUTE_HANDLER
;
}
static
void
CALLBACK
execute_chore_finally
(
BOOL
normal
,
void
*
data
)
{
ExternalContextBase
*
ctx
=
(
ExternalContextBase
*
)
try_get_current_context
();
_StructuredTaskCollection
*
old_collection
=
data
;
if
(
ctx
&&
ctx
->
context
.
vtable
==
&
ExternalContextBase_vtable
)
ctx
->
task_collection
=
old_collection
;
}
static
void
execute_chore
(
_UnrealizedChore
*
chore
,
_StructuredTaskCollection
*
task_collection
)
{
ExternalContextBase
*
ctx
=
(
ExternalContextBase
*
)
try_get_current_context
();
struct
execute_chore_data
data
=
{
chore
,
task_collection
};
_StructuredTaskCollection
*
old_collection
;
TRACE
(
"(%p %p)
\n
"
,
chore
,
task_collection
);
__TRY
if
(
ctx
&&
ctx
->
context
.
vtable
==
&
ExternalContextBase_vtable
)
{
if
(
!
((
ULONG_PTR
)
task_collection
->
exception
&
~
STRUCTURED_TASK_COLLECTION_STATUS_MASK
)
&&
chore
->
chore_proc
)
chore
->
chore_proc
(
chore
);
old_collection
=
ctx
->
task_collection
;
ctx
->
task_collection
=
task_collection
;
}
__EXCEPT_CTX
(
execute_chore_except
,
&
data
)
__TRY
{
__TRY
{
if
(
!
((
ULONG_PTR
)
task_collection
->
exception
&
~
STRUCTURED_TASK_COLLECTION_STATUS_MASK
)
&&
chore
->
chore_proc
)
chore
->
chore_proc
(
chore
);
}
__EXCEPT_CTX
(
execute_chore_except
,
&
data
)
{
}
__ENDTRY
}
__
ENDTRY
__
FINALLY_CTX
(
execute_chore_finally
,
old_collection
)
}
static
void
CALLBACK
chore_wrapper_finally
(
BOOL
normal
,
void
*
data
)
...
...
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