| 1139 | } |
| 1140 | |
| 1141 | void Node::set_process_priority(int p_priority) { |
| 1142 | ERR_THREAD_GUARD |
| 1143 | if (data.process_priority == p_priority) { |
| 1144 | return; |
| 1145 | } |
| 1146 | if (!is_inside_tree()) { |
| 1147 | // Not yet in the tree; trivial update. |
| 1148 | data.process_priority = p_priority; |
| 1149 | return; |
| 1150 | } |
| 1151 | |
| 1152 | if (_is_any_processing()) { |
| 1153 | _remove_from_process_thread_group(); |
| 1154 | } |
| 1155 | |
| 1156 | data.process_priority = p_priority; |
| 1157 | |
| 1158 | if (_is_any_processing()) { |
| 1159 | _add_to_process_thread_group(); |
| 1160 | } |
| 1161 | } |
| 1162 | |
| 1163 | int Node::get_process_priority() const { |
| 1164 | return data.process_priority; |