Updated locks to new syntax - they should work now - and fixed deadlock between current and total frame functions