Locking protocols: general lock classes and deadlock freedom