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
c019ebc8
Commit
c019ebc8
authored
Jul 16, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp: Implement _vcomp_sections_init and _vcomp_sections_next.
parent
9c9d60f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
6 deletions
+54
-6
main.c
dlls/vcomp/main.c
+48
-0
vcomp.spec
dlls/vcomp/vcomp.spec
+2
-2
vcomp100.spec
dlls/vcomp100/vcomp100.spec
+2
-2
vcomp90.spec
dlls/vcomp90/vcomp90.spec
+2
-2
No files found.
dlls/vcomp/main.c
View file @
c019ebc8
...
...
@@ -58,6 +58,9 @@ struct vcomp_thread_data
/* only used for concurrent tasks */
struct
list
entry
;
CONDITION_VARIABLE
cond
;
/* section */
unsigned
int
section
;
};
struct
vcomp_team_data
...
...
@@ -74,6 +77,11 @@ struct vcomp_team_data
/* barrier */
unsigned
int
barrier
;
int
barrier_count
;
/* section */
unsigned
int
section
;
int
num_sections
;
int
section_index
;
};
#if defined(__i386__)
...
...
@@ -301,6 +309,42 @@ void CDECL _vcomp_single_end(void)
TRACE
(
"stub
\n
"
);
}
void
CDECL
_vcomp_sections_init
(
int
n
)
{
struct
vcomp_thread_data
*
thread_data
=
vcomp_get_thread_data
();
struct
vcomp_team_data
*
team_data
=
thread_data
->
team
;
TRACE
(
"(%d)
\n
"
,
n
);
EnterCriticalSection
(
&
vcomp_section
);
thread_data
->
section
++
;
if
((
int
)(
thread_data
->
section
-
team_data
->
section
)
>
0
)
{
team_data
->
section
=
thread_data
->
section
;
team_data
->
num_sections
=
n
;
team_data
->
section_index
=
0
;
}
LeaveCriticalSection
(
&
vcomp_section
);
}
int
CDECL
_vcomp_sections_next
(
void
)
{
struct
vcomp_thread_data
*
thread_data
=
vcomp_get_thread_data
();
struct
vcomp_team_data
*
team_data
=
thread_data
->
team
;
int
i
=
-
1
;
TRACE
(
"()
\n
"
);
EnterCriticalSection
(
&
vcomp_section
);
if
(
thread_data
->
section
==
team_data
->
section
&&
team_data
->
section_index
!=
team_data
->
num_sections
)
{
i
=
team_data
->
section_index
++
;
}
LeaveCriticalSection
(
&
vcomp_section
);
return
i
;
}
static
DWORD
WINAPI
_vcomp_fork_worker
(
void
*
param
)
{
struct
vcomp_thread_data
*
thread_data
=
param
;
...
...
@@ -368,10 +412,12 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
__ms_va_start
(
team_data
.
valist
,
wrapper
);
team_data
.
barrier
=
0
;
team_data
.
barrier_count
=
0
;
team_data
.
section
=
0
;
thread_data
.
team
=
&
team_data
;
thread_data
.
thread_num
=
0
;
thread_data
.
fork_threads
=
0
;
thread_data
.
section
=
1
;
list_init
(
&
thread_data
.
entry
);
InitializeConditionVariable
(
&
thread_data
.
cond
);
...
...
@@ -387,6 +433,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
data
->
team
=
&
team_data
;
data
->
thread_num
=
team_data
.
num_threads
++
;
data
->
fork_threads
=
0
;
data
->
section
=
1
;
list_remove
(
&
data
->
entry
);
list_add_tail
(
&
thread_data
.
entry
,
&
data
->
entry
);
WakeAllConditionVariable
(
&
data
->
cond
);
...
...
@@ -405,6 +452,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
data
->
team
=
&
team_data
;
data
->
thread_num
=
team_data
.
num_threads
;
data
->
fork_threads
=
0
;
data
->
section
=
1
;
InitializeConditionVariable
(
&
data
->
cond
);
thread
=
CreateThread
(
NULL
,
0
,
_vcomp_fork_worker
,
data
,
0
,
NULL
);
...
...
dlls/vcomp/vcomp.spec
View file @
c019ebc8
...
...
@@ -83,8 +83,8 @@
@ stub _vcomp_reduction_u2
@ stub _vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@
stub _vcomp_sections_init
@
stub _vcomp_sections_next
@
cdecl _vcomp_sections_init(long)
@
cdecl _vcomp_sections_next()
@ cdecl _vcomp_set_num_threads(long)
@ cdecl _vcomp_single_begin(long)
@ cdecl _vcomp_single_end()
...
...
dlls/vcomp100/vcomp100.spec
View file @
c019ebc8
...
...
@@ -83,8 +83,8 @@
@ stub _vcomp_reduction_u2
@ stub _vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@
stub
_vcomp_sections_init
@
stub
_vcomp_sections_next
@
cdecl _vcomp_sections_init(long) vcomp.
_vcomp_sections_init
@
cdecl _vcomp_sections_next() vcomp.
_vcomp_sections_next
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
...
...
dlls/vcomp90/vcomp90.spec
View file @
c019ebc8
...
...
@@ -83,8 +83,8 @@
@ stub _vcomp_reduction_u2
@ stub _vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@
stub
_vcomp_sections_init
@
stub
_vcomp_sections_next
@
cdecl _vcomp_sections_init(long) vcomp.
_vcomp_sections_init
@
cdecl _vcomp_sections_next() vcomp.
_vcomp_sections_next
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
...
...
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