anchor.diff:           Return,
            reset_req_start_time(State)))};
   handle_info(?sedge_leave_readloop, State) ->
  -    {stop, normal, State}.
  -
  -%%------------------------------------------------------------------------------
  -%% @private
  -%%------------------------------------------------------------------------------
  -terminate(_Reason, State) -> maybe_shutdown(State).
  +    {stop, normal, State};
  +handle_info({timeout, Ref, check}, State = #state{timer = Ref}) ->
  +    %% The idea behind this:
  +    %% Create a recurring timer, that checks whether the last operation is still
  +    %% in progress (which means it is blocked). In this case crash this server,
  +    %% which kills the corresponding port process and let it get restarted in
  +    %% the supervisor.
  +    case is_blocked_for_too_long(State, ?CHECK_ALIVE_INTERVAL) of
  +        true  -> {stop, io_blocked, State};
  +        false -> {noreply, State#state{timer = start_check()}}
  +    end.
  +
  +%%------------------------------------------------------------------------------
  +%% @private
  +%%------------------------------------------------------------------------------
  +terminate(Reason, State) -> maybe_shutdown(fail_all(Reason, State)).
   
   %%------------------------------------------------------------------------------
   %% @private
  
positive.code: %%------------------------------------------------------------------------------
  %% @private
  %%------------------------------------------------------------------------------
  -spec fail_all(safeio:ioerror(), #state{}) -> #state{}.
  fail_all(E, State = #state{ pending = Ps }) ->
      lists:map(
        fun({_,P}) ->
  
negative.code:                                 {{get_filetype, RelPath}, TimeOutMillis},
                                  TimeOutMillis)
              catch
                  exit:_ -> {error, timeout}
              end
      end.
  
  