This issue tracks the fix to address the code review comment in #226.
Make an issue to look into this please - at the very least I'd like to try and refactor this slightly to make this easier to understand. All this locking stuff I want to go over anyways since right now it seems kind of arbitrary where the locks are acquired/released which could easily lead to issues later on.
Originally posted by @Charles-Gagnon in #226 (comment)