Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
bed8d8a6
Commit
bed8d8a6
authored
Feb 01, 2013
by
Alan Modra
Committed by
Alan Modra
Feb 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task.c (GOMP_task, [...]): Comment.
* task.c (GOMP_task, GOMP_taskwait): Comment. From-SVN: r195647
parent
8c7ca45c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
libgomp/ChangeLog
+4
-0
libgomp/task.c
+15
-0
No files found.
libgomp/ChangeLog
View file @
bed8d8a6
2013-02-01 Alan Modra <amodra@gmail.com>
* task.c (GOMP_task, GOMP_taskwait): Comment.
2013-01-31 Dmitry Vyukov <dvyukov@gcc.gnu.org>
Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
...
...
libgomp/task.c
View file @
bed8d8a6
...
...
@@ -116,6 +116,15 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
}
else
fn
(
data
);
/* Access to "children" is normally done inside a task_lock
mutex region, but the only way this particular task.children
can be set is if this thread's task work function (fn)
creates children. So since the setter is *this* thread, we
need no barriers here when testing for non-NULL. We can have
task.children set by the current thread then changed by a
child thread, but seeing a stale non-NULL value is not a
problem. Once past the task_lock acquisition, this thread
will see the real value of task.children. */
if
(
task
.
children
!=
NULL
)
{
gomp_mutex_lock
(
&
team
->
task_lock
);
...
...
@@ -296,6 +305,12 @@ GOMP_taskwait (void)
struct
gomp_task
*
child_task
=
NULL
;
struct
gomp_task
*
to_free
=
NULL
;
/* The acquire barrier on load of task->children here synchronizes
with the write of a NULL in gomp_barrier_handle_tasks. It is
not necessary that we synchronize with other non-NULL writes at
this point, but we must ensure that all writes to memory by a
child thread task work function are seen before we exit from
GOMP_taskwait. */
if
(
task
==
NULL
||
__atomic_load_n
(
&
task
->
children
,
MEMMODEL_ACQUIRE
)
==
NULL
)
return
;
...
...
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