This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead.