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
e26a9fb4
Commit
e26a9fb4
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_barrier.
parent
ee34265f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
main.c
dlls/vcomp/main.c
+27
-1
No files found.
dlls/vcomp/main.c
View file @
e26a9fb4
...
...
@@ -70,6 +70,10 @@ struct vcomp_team_data
int
nargs
;
void
*
wrapper
;
__ms_va_list
valist
;
/* barrier */
unsigned
int
barrier
;
int
barrier_count
;
};
#if defined(__i386__)
...
...
@@ -256,7 +260,27 @@ void CDECL omp_set_num_threads(int num_threads)
void
CDECL
_vcomp_barrier
(
void
)
{
TRACE
(
"stub
\n
"
);
struct
vcomp_team_data
*
team_data
=
vcomp_init_thread_data
()
->
team
;
TRACE
(
"()
\n
"
);
if
(
!
team_data
)
return
;
EnterCriticalSection
(
&
vcomp_section
);
if
(
++
team_data
->
barrier_count
>=
team_data
->
num_threads
)
{
team_data
->
barrier
++
;
team_data
->
barrier_count
=
0
;
WakeAllConditionVariable
(
&
team_data
->
cond
);
}
else
{
unsigned
int
barrier
=
team_data
->
barrier
;
while
(
team_data
->
barrier
==
barrier
)
SleepConditionVariableCS
(
&
team_data
->
cond
,
&
vcomp_section
,
INFINITE
);
}
LeaveCriticalSection
(
&
vcomp_section
);
}
void
CDECL
_vcomp_set_num_threads
(
int
num_threads
)
...
...
@@ -342,6 +366,8 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
team_data
.
nargs
=
nargs
;
team_data
.
wrapper
=
wrapper
;
__ms_va_start
(
team_data
.
valist
,
wrapper
);
team_data
.
barrier
=
0
;
team_data
.
barrier_count
=
0
;
thread_data
.
team
=
&
team_data
;
thread_data
.
thread_num
=
0
;
...
...
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