First stab at fixing the lock starvation issue by sleeping... not at all happy with this solution, though.