bigfile/virtmem: Factor functionality to unlock/retake GIL into own functions
Previously we were doing virt_lock() / virt_unlock() which automatically were making sure to unlock GIL before locking virtmem, and to restore GIL state to previous after virtmem lock happened. virt_unlock() was unlocking just the virtmem lock without touching GIL at all - that works because the running code would eventually release GIL as python regularly does so to allowing multiple threads to run. In the next patch however, we'll need to wait for in-progress-loading page to complete, and that wait has to be done with GIL released (so other python threads could run), and for doing so we'll need functionality to make sure GIL is unlocked and retake it back, not tied to virt_lock(). So factor it out.
Showing with 19 additions and 4 deletions