should be held at that point and it must be safe to sleep there), and
add:
- try_to_freeze(PF_FREEZE);
+ try_to_freeze();
If the thread is needed for writing the image to storage, you should
instead set the PF_NOFREEZE process flag when creating the thread (and