summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-23 08:19:09 +0100
committerGitHub <noreply@github.com>2020-01-23 08:19:09 +0100
commitc9cf6b102f65e277613a0ff2f2bcc54f7bff0f1d (patch)
tree7fab75c48809ecec2bdd9c6750203eb33d7812b1
parent05fc26de1cd4b11f9f3351b42fb4c5b7c626856d (diff)
parent90a1f8d8a7789c6fa9191c8684cd24edca066577 (diff)
Merge pull request #35454 from Calinou/os-execute-default-blocking
Make `OS.execute()` blocking by default if not specified
-rw-r--r--core/bind/core_bind.cpp2
-rw-r--r--core/bind/core_bind.h2
-rw-r--r--core/os/os.h2
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--drivers/unix/os_unix.h2
-rw-r--r--platform/javascript/os_javascript.h2
-rw-r--r--platform/uwp/os_uwp.h2
-rw-r--r--platform/windows/os_windows.h2
8 files changed, 8 insertions, 8 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);
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 2c44a3dfb0..a37fb28901 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -95,7 +95,7 @@
</argument>
<argument index="1" name="arguments" type="PoolStringArray">
</argument>
- <argument index="2" name="blocking" type="bool">
+ <argument index="2" name="blocking" type="bool" default="true">
</argument>
<argument index="3" name="output" type="Array" default="[ ]">
</argument>
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 8ce0eca8c6..c381890834 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -85,7 +85,7 @@ public:
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() 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);
+ 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);
virtual Error kill(const ProcessID &p_pid);
virtual int get_process_id() const;
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index 2d1c765e76..5c02a292ee 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -141,7 +141,7 @@ public:
void run_async();
bool main_loop_iterate();
- 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);
+ 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);
virtual Error kill(const ProcessID &p_pid);
virtual int get_process_id() const;
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index edc63bd637..e032b501f9 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -205,7 +205,7 @@ public:
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() 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);
+ 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);
virtual Error kill(const ProcessID &p_pid);
virtual bool has_environment(const String &p_var) const;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 65d08f5d36..cf16295a70 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -359,7 +359,7 @@ public:
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() 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);
+ 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);
virtual Error kill(const ProcessID &p_pid);
virtual int get_process_id() const;