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
......@@ -380,6 +380,11 @@ void task_unlock(struct task *t) {
cell_munlocktree(cj);
break;
case task_type_star_formation:
cell_unlocktree(ci);
cell_sunlocktree(ci);
cell_gunlocktree(ci);
default:
break;
}
......@@ -518,6 +523,21 @@ int task_lock(struct task *t) {
cell_munlocktree(ci);
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:
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment