diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-01-23 01:25:47 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-01-23 01:26:32 +0100 |
commit | 90a1f8d8a7789c6fa9191c8684cd24edca066577 (patch) | |
tree | ae0045aac1b5da04f66be3b49ca1625a0e93ba45 /core | |
parent | 94d3bcbc9b523a8aae4cc0dd1f1e522c2171900e (diff) | |
download | redot-engine-90a1f8d8a7789c6fa9191c8684cd24edca066577.tar.gz |
Make `OS.execute()` blocking by default if not specified
This makes `OS.execute()` calls quicker to set up when calling programs
in a blocking fashion.
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 2 | ||||
-rw-r--r-- | core/bind/core_bind.h | 2 | ||||
-rw-r--r-- | core/os/os.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 95f433607c..efd7e3dbf5 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1266,7 +1266,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_processor_count"), &_OS::get_processor_count); ClassDB::bind_method(D_METHOD("get_executable_path"), &_OS::get_executable_path); - ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "blocking", "output", "read_stderr"), &_OS::execute, DEFVAL(Array()), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "blocking", "output", "read_stderr"), &_OS::execute, DEFVAL(true), DEFVAL(Array()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("kill", "pid"), &_OS::kill); ClassDB::bind_method(D_METHOD("shell_open", "uri"), &_OS::shell_open); ClassDB::bind_method(D_METHOD("get_process_id"), &_OS::get_process_id); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 65f20c375e..87da51f97e 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -227,7 +227,7 @@ public: int get_low_processor_usage_mode_sleep_usec() const; String get_executable_path() const; - int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking, Array p_output = Array(), bool p_read_stderr = false); + int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking = true, Array p_output = Array(), bool p_read_stderr = false); Error kill(int p_pid); Error shell_open(String p_uri); diff --git a/core/os/os.h b/core/os/os.h index 714c4e3f09..80b5843bd5 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -267,7 +267,7 @@ public: virtual int get_low_processor_usage_mode_sleep_usec() const; virtual String get_executable_path() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0; + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0; virtual Error kill(const ProcessID &p_pid) = 0; virtual int get_process_id() const; virtual void vibrate_handheld(int p_duration_ms = 500); |