private string InnerRunRelayAction(IBasicAction portAction, string description) { IBasicNotificationList notifyOnComplete = portAction.NotifyOnComplete; try { notifyOnComplete.AddItem(threadWakeupNotifier); string resultCode = Fcns.MapNullOrEmptyTo(portAction.Start(), null); while (resultCode == null) { WaitForSomethingToDo(); InnerServiceFCServerAndStateRelay(); if (portAction.ActionState.IsComplete) { break; } } resultCode = (portAction.ActionState.ResultCode ?? Fcns.CheckedFormat("Internal: port.{0} complete with null ResultCode", description)); return(resultCode); } finally { notifyOnComplete.RemoveItem(threadWakeupNotifier); } }