Lines Matching +full:pre +full:- +full:timeout

111 /// Prepares a subprocess to run a user-provided hook in a controlled manner.
114 /// \param control_directory Path to the subprocess-specific control directory.
115 /// \param work_directory Path to the subprocess-specific work directory.
133 /// Path to the subprocess-specific work directory.
151 /// Number of owners of the on-disk state.
157 /// \param control_directory_ Path to the subprocess-specific work
162 /// \param timeout Maximum amount of time the subprocess can run for.
165 /// \param [in,out] state_owners_ Number of owners of the on-disk state.
166 /// For first-time processes, this should be a new counter set to 0;
174 const datetime::delta& timeout, in impl()
183 timer(timeout, pid_), in impl()
213 return _pimpl->pid; in pid()
217 /// Returns the path to the subprocess-specific control directory.
225 return _pimpl->control_directory; in control_directory()
229 /// Returns the path to the subprocess-specific work directory.
237 return _pimpl->control_directory / detail::work_subdir; in work_directory()
247 return _pimpl->stdout_file; in stdout_file()
257 return _pimpl->stderr_file; in stderr_file()
281 /// Path to the subprocess-specific work directory.
290 /// Number of owners of the on-disk state.
292 /// This will be 1 if this exit_handle is the last holder of the on-disk
319 /// \param control_directory_ Path to the subprocess-specific work
323 /// \param [in,out] state_owners_ Number of owners of the on-disk state.
361 /// Cleans up the subprocess on-disk state.
368 PRE(*state_owners > 0); in cleanup()
374 "%s owners left") % original_pid % (*state_owners - 1)); in cleanup()
381 (*state_owners)--; in cleanup()
418 PRE(!_pimpl->cleaned); in cleanup()
419 _pimpl->cleanup(); in cleanup()
420 POST(_pimpl->cleaned); in cleanup()
424 /// Gets the current number of owners of the on-disk data.
433 return _pimpl->state_owners; in state_owners()
443 return _pimpl->original_pid; in original_pid()
453 return _pimpl->status; in status()
464 return _pimpl->unprivileged_user; in unprivileged_user()
474 return _pimpl->start_time; in start_time()
484 return _pimpl->end_time; in end_time()
488 /// Returns the path to the subprocess-specific control directory.
496 return _pimpl->control_directory; in control_directory()
500 /// Returns the path to the subprocess-specific work directory.
508 return _pimpl->control_directory / detail::work_subdir; in work_directory()
518 return _pimpl->stdout_file; in stdout_file()
528 return _pimpl->stderr_file; in stderr_file()
590 PRE(!cleaned); in cleanup()
599 if (::waitpid(pid, &status, 0) == -1) { in cleanup()
628 // individually wiped the subdirectories of any still-unclean in cleanup()
630 root_work_directory->cleanup(); in cleanup()
634 root_work_directory->directory() % e.what()); in cleanup()
638 interrupts_handler->unprogram(); in cleanup()
647 /// \return A pointer to an object describing the waited-for subprocess.
651 PRE(original_pid == status.dead_pid()); in post_wait()
659 data._pimpl->timer.unprogram(); in post_wait()
663 // always the case though: for short-lived processes and with very short in post_wait()
682 data._pimpl->timer.fired() ? in post_wait()
684 data._pimpl->unprivileged_user, in post_wait()
685 data._pimpl->start_time, datetime::timestamp::now(), in post_wait()
689 data._pimpl->state_owners, in post_wait()
699 data._pimpl->timer.unprogram(); in reap()
712 data._pimpl->unprivileged_user, in reap()
713 data._pimpl->start_time, datetime::timestamp::now(), in reap()
717 data._pimpl->state_owners, in reap()
741 return _pimpl->root_work_directory->directory(); in root_work_directory()
755 PRE(!_pimpl->cleaned); in cleanup()
756 _pimpl->cleanup(); in cleanup()
757 _pimpl->cleaned = true; in cleanup()
763 /// \pre This function can only be called if there is no other executor_handle
774 /// Pre-helper for the spawn() method.
782 ++_pimpl->last_subprocess; in spawn_pre()
785 _pimpl->root_work_directory->directory() / in spawn_pre()
786 (F("%s") % _pimpl->last_subprocess); in spawn_pre()
793 /// Post-helper for the spawn() method.
798 /// \param timeout Maximum amount of time the subprocess can run for.
808 const datetime::delta& timeout, in spawn_post() argument
814 child->pid(), in spawn_post()
819 timeout, in spawn_post()
823 auto insert_pair = _pimpl->all_exec_handles.insert(value); in spawn_post()
826 _pimpl->stale_exec_handles.push_front(insert_pair.first->second); in spawn_post()
827 _pimpl->all_exec_handles.erase(insert_pair.first); in spawn_post()
828 insert_pair = _pimpl->all_exec_handles.insert(value); in spawn_post()
837 /// Pre-helper for the spawn_followup() method.
845 /// Post-helper for the spawn_followup() method.
848 /// \param timeout Maximum amount of time the subprocess can run for.
855 const datetime::delta& timeout, in spawn_followup_post() argument
861 child->pid(), in spawn_followup_post()
866 timeout, in spawn_followup_post()
870 auto insert_pair = _pimpl->all_exec_handles.insert(value); in spawn_followup_post()
873 _pimpl->stale_exec_handles.push_front(insert_pair.first->second); in spawn_followup_post()
874 _pimpl->all_exec_handles.erase(insert_pair.first); in spawn_followup_post()
875 insert_pair = _pimpl->all_exec_handles.insert(value); in spawn_followup_post()
888 /// \return A pointer to an object describing the waited-for subprocess.
894 return _pimpl->post_wait(exec_handle.pid(), status); in wait()
900 /// \return A pointer to an object describing the waited-for subprocess.
906 return _pimpl->post_wait(status.dead_pid(), status); in wait_any()
920 return _pimpl->reap(pid); in reap()