Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
5bd48e07
Commit
5bd48e07
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also apply the same procedure for the black holes swallowing.
parent
431c0d7f
No related branches found
No related tags found
1 merge request
!858
Lock before removing particles
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+18
-8
18 additions, 8 deletions
src/runner.c
with
18 additions
and
8 deletions
src/runner.c
+
18
−
8
View file @
5bd48e07
...
...
@@ -3822,10 +3822,15 @@ void runner_do_swallow(struct runner *r, struct cell *c, int timer) {
lock_lock
(
&
e
->
s
->
lock
);
/* Finally, remove the gas particle from the system */
struct
gpart
*
gp
=
p
->
gpart
;
cell_remove_part
(
e
,
c
,
p
,
xp
);
cell_remove_gpart
(
e
,
c
,
gp
);
/* Re-check that the particle has not been removed
* by another thread before we do the deed. */
if
(
!
part_is_inhibited
(
p
,
e
))
{
/* Finally, remove the gas particle from the system */
struct
gpart
*
gp
=
p
->
gpart
;
cell_remove_part
(
e
,
c
,
p
,
xp
);
cell_remove_gpart
(
e
,
c
,
gp
);
}
if
(
lock_unlock
(
&
e
->
s
->
lock
)
!=
0
)
error
(
"Failed to unlock the space!"
);
...
...
@@ -3860,10 +3865,15 @@ void runner_do_swallow(struct runner *r, struct cell *c, int timer) {
lock_lock
(
&
e
->
s
->
lock
);
/* Finally, remove the gas particle from the system */
struct
gpart
*
gp
=
p
->
gpart
;
cell_remove_part
(
e
,
c
,
p
,
xp
);
cell_remove_gpart
(
e
,
c
,
gp
);
/* Re-check that the particle has not been removed
* by another thread before we do the deed. */
if
(
!
part_is_inhibited
(
p
,
e
))
{
/* Finally, remove the gas particle from the system */
struct
gpart
*
gp
=
p
->
gpart
;
cell_remove_part
(
e
,
c
,
p
,
xp
);
cell_remove_gpart
(
e
,
c
,
gp
);
}
if
(
lock_unlock
(
&
e
->
s
->
lock
)
!=
0
)
error
(
"Failed to unlock the space!"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment