A resource-control model based on deadlock avoidance