Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
90a1f8d8
Unverified
Commit
90a1f8d8
authored
Jan 23, 2020
by
Hugo Locurcio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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.
parent
94d3bcbc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
8 deletions
+8
-8
core_bind.cpp
core/bind/core_bind.cpp
+1
-1
core_bind.h
core/bind/core_bind.h
+1
-1
os.h
core/os/os.h
+1
-1
OS.xml
doc/classes/OS.xml
+1
-1
os_unix.h
drivers/unix/os_unix.h
+1
-1
os_javascript.h
platform/javascript/os_javascript.h
+1
-1
os_uwp.h
platform/uwp/os_uwp.h
+1
-1
os_windows.h
platform/windows/os_windows.h
+1
-1
No files found.
core/bind/core_bind.cpp
View file @
90a1f8d8
...
...
@@ -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
);
...
...
core/bind/core_bind.h
View file @
90a1f8d8
...
...
@@ -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
);
...
...
core/os/os.h
View file @
90a1f8d8
...
...
@@ -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
);
...
...
doc/classes/OS.xml
View file @
90a1f8d8
...
...
@@ -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>
...
...
drivers/unix/os_unix.h
View file @
90a1f8d8
...
...
@@ -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
;
...
...
platform/javascript/os_javascript.h
View file @
90a1f8d8
...
...
@@ -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
;
...
...
platform/uwp/os_uwp.h
View file @
90a1f8d8
...
...
@@ -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
;
...
...
platform/windows/os_windows.h
View file @
90a1f8d8
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment