Change os::timeout from minutes to milliseconds

We can now specify the special value of "-1" milliseconds which is
interpreted as disabling the timeout.

No change of functionality intended.
This commit is contained in:
Scott Kostyshak 2022-11-25 09:51:30 -05:00
parent 0219e63b35
commit 68c7953422
3 changed files with 7 additions and 5 deletions

View File

@ -290,7 +290,7 @@ int Systemcall::startscript(Starttype how, string const & what,
}
if (!d.waitWhile(SystemcallPrivate::Running, do_events,
os::timeout_min() * 60 * 1000)) {
os::timeout_ms())) {
if (d.state == SystemcallPrivate::Killed) {
LYXERR0("Killed: " << cmd);
return KILLED;

View File

@ -45,9 +45,11 @@ namespace lyx {
namespace support {
namespace os {
int timeout_min()
int timeout_ms()
{
return 3;
// return -1 to disable the timeout completely.
// (-1 is a special case in SystemcallPrivate::waitWhile()).
return 3 * 60 * 1000;
}

View File

@ -55,8 +55,8 @@ std::string current_root();
///
shell_type shell();
/// Returns no. of minutes allowed for a command to complete.
int timeout_min();
/// Returns no. of milliseconds allowed for a command to complete.
int timeout_ms();
/// Name of the python interpreter
/// @param reset True if the python path should be recomputed