Distributed event-control for deadlock avoidance in automated manufacturing systems