It needs to be recursive because the setState() function also locks. Since handleEndEffector calls a user-supplied callback, wherein the user can then call setState(), it can get stuck if the mutex isn't recursive.