         process.removeObserver(self,
                                forKeyPath: #keyPath(Process.isRunning),
                                context: &TimedProcessRunnerObserver.KVOContext)
-        self.pendingLogHandles.removeValue(forKey: process)
+        accessPendingLogHandles { pendingLogHandles in
+          _ = pendingLogHandles.removeValue(forKey: process)
+        }
       }
     }
 

          let newValue = change?[NSKeyValueChangeKey.newKey] as? NSNumber,
          newValue.boolValue,
          let process = object as? Process {
        pendingLogHandles[process]?.resetStartTime()
      }
    }
  }

// See the License for the specific language governing permissions and
// limitations under the License.

import Darwin
import Foundation

/// Encapsulates functionality to launch and manage Processes.
public final class ProcessRunner {
