Skip to content
Snippets Groups Projects
Commit 48f5ecb7 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make the star formation task lock it's part of the tree.

parent e295df53
Branches
Tags
2 merge requests!688Star formation (non-MPI),!684Add star particles on-the-fly
...@@ -380,6 +380,11 @@ void task_unlock(struct task *t) { ...@@ -380,6 +380,11 @@ void task_unlock(struct task *t) {
cell_munlocktree(cj); cell_munlocktree(cj);
break; break;
case task_type_star_formation:
cell_unlocktree(ci);
cell_sunlocktree(ci);
cell_gunlocktree(ci);
default: default:
break; break;
} }
...@@ -518,6 +523,21 @@ int task_lock(struct task *t) { ...@@ -518,6 +523,21 @@ int task_lock(struct task *t) {
cell_munlocktree(ci); cell_munlocktree(ci);
return 0; return 0;
} }
break;
case task_type_star_formation:
/* Lock the gas, gravity and star particles */
if (ci->hydro.hold || ci->stars.hold || ci->grav.phold) return 0;
if (cell_locktree(ci) != 0) return 0;
if (cell_slocktree(ci) != 0) {
cell_unlocktree(ci);
return 0;
}
if (cell_glocktree(ci) != 0) {
cell_unlocktree(ci);
cell_sunlocktree(ci);
return 0;
}
default: default:
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment