Search results

There are no results.

std.io.stop_blocking

Show source code
Hide source code
fn pub stop_blocking -> Int {
  let err = libc.errno

  # If the operation took too long, this reschedules the current process. This
  # means that any global state read after this point may not be from the same
  # thread as the IO call is performed on.
  inko_process_stop_blocking(_INKO.process)
  err
}
fn pub static stop_blocking -> Int

Signals the end of a C function call that may perform blocking IO operations.

The return value is the value of errno as an Int. This value is read before signalling the end of the blocking call, ensuring we read the value from the same thread the IO call is performed on.

If start_blocking is called multiple times, this method must be called the same number of times. In this case only the last call may reschedule the current process. If a C function call mutates any global state, that state must be retrieved before the final call to this method, as upon being rescheduled the current process may run on a different OS thread and thus read a different state.