added code to enable graceful exit of iLock by setting a named event