process: make pause/unpause public - see #1257
This commit is contained in:
@@ -134,20 +134,6 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
/*! @brief Stops a process if it's running, otherwise does nothing. */
|
||||
void pause() noexcept {
|
||||
if(current == state::running) {
|
||||
current = state::paused;
|
||||
}
|
||||
}
|
||||
|
||||
/*! @brief Restarts a process if it's paused, otherwise does nothing. */
|
||||
void unpause() noexcept {
|
||||
if(current == state::paused) {
|
||||
current = state::running;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
/*! @brief Type used to provide elapsed time. */
|
||||
using delta_type = Delta;
|
||||
@@ -192,6 +178,20 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*! @brief Stops a process if it's running, otherwise does nothing. */
|
||||
void pause() noexcept {
|
||||
if(current == state::running) {
|
||||
current = state::paused;
|
||||
}
|
||||
}
|
||||
|
||||
/*! @brief Restarts a process if it's paused, otherwise does nothing. */
|
||||
void unpause() noexcept {
|
||||
if(current == state::paused) {
|
||||
current = state::running;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns true if a process is either running or paused.
|
||||
* @return True if the process is still alive, false otherwise.
|
||||
|
||||
Reference in New Issue
Block a user