Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
3147ec22
Commit
3147ec22
authored
Oct 03, 2012
by
Pedro Gonnet
Browse files
force memory barrier on unlock.
Former-commit-id: a0fabfb1a0670c165c72008aee48a98a67f9011d
parent
f021bd3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lock.h
View file @
3147ec22
...
...
@@ -45,5 +45,5 @@
return
0
;
}
#define lock_trylock( l ) ( ( *(l) ) ? 1 : __sync_val_compare_and_swap( l , 0 , 1 ) )
#define lock_unlock( l ) (
*l = 0
)
#define lock_unlock( l ) (
__sync_lock_test_and_set( l , 0 ) != 1
)
#endif
src/runner.c
View file @
3147ec22
...
...
@@ -1371,7 +1371,8 @@ void *runner_main ( void *data ) {
/* Resolve any dependencies. */
for
(
k
=
0
;
k
<
t
->
nr_unlock_tasks
;
k
++
)
__sync_fetch_and_sub
(
&
t
->
unlock_tasks
[
k
]
->
wait
,
1
);
if
(
__sync_fetch_and_sub
(
&
t
->
unlock_tasks
[
k
]
->
wait
,
1
)
==
0
)
abort
();
for
(
k
=
0
;
k
<
t
->
nr_unlock_cells
;
k
++
)
__sync_fetch_and_sub
(
&
t
->
unlock_cells
[
k
]
->
wait
,
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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