sleep_os Subroutine

private subroutine sleep_os(s)

OS-backed sleep for approximately s seconds.

This routine delegates to the C shim fpm_watch_sleep_seconds, which performs platform-native sleeping (Windows Sleep, POSIX nanosleep).

The fpm_environment OS check is retained for clarity and future platform-specific extensions, but both branches call the same shim.

Arguments

  • s: requested duration in seconds. Non-positive values return immediately.

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: s

Calls

proc~~sleep_os~~CallsGraph proc~sleep_os sleep_os get_os_type get_os_type proc~sleep_os->get_os_type interface~fpm_watch_sleep_seconds fpm_watch_sleep_seconds proc~sleep_os->interface~fpm_watch_sleep_seconds

Called by

proc~~sleep_os~~CalledByGraph proc~sleep_os sleep_os proc~sleep_seconds sleep_seconds proc~sleep_seconds->proc~sleep_os proc~supervisor_loop supervisor_loop proc~supervisor_loop->proc~sleep_seconds proc~watcher_run watcher_t%watcher_run proc~watcher_run->proc~sleep_seconds proc~maybe_supervise maybe_supervise proc~maybe_supervise->proc~supervisor_loop

Source Code

   subroutine sleep_os(s)
      real, intent(in) :: s
      if (get_os_type() == OS_WINDOWS) then
         call fpm_watch_sleep_seconds(real(s, c_double))
      else
         call fpm_watch_sleep_seconds(real(s, c_double))
      end if
   end subroutine sleep_os