]> git.lyx.org Git - features.git/commitdiff
Change os::timeout from minutes to milliseconds
authorScott Kostyshak <skostysh@lyx.org>
Fri, 25 Nov 2022 14:51:30 +0000 (09:51 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 25 Nov 2022 14:51:30 +0000 (09:51 -0500)
We can now specify the special value of "-1" milliseconds which is
interpreted as disabling the timeout.

No change of functionality intended.

src/support/Systemcall.cpp
src/support/os.cpp
src/support/os.h

index 20fe1034b96d43f735941097197c446943332a81..7c4eaabc979490ae61930b290425582e83e262e5 100644 (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;
index 407e1de4fc0182f256673fccad8f7033e64dc6f3..8fd64920b848289cc35b40c6bd806393640e3e08 100644 (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;
 }
 
 
index 07d6d7ba76cf5398e449ed676835637cb9c22acb..d89af7dca46a98c6489d9231f9974ad038f90fff 100644 (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