Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script. This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function. Documentation is updated to reflect new API function.
This commit is contained in:
parent
1b2992799b
commit
f3c1232c59
12 changed files with 56 additions and 0 deletions
|
|
@ -269,6 +269,10 @@ Error OS::kill(int p_pid) {
|
|||
return ::OS::get_singleton()->kill(p_pid);
|
||||
}
|
||||
|
||||
bool OS::is_process_running(int p_pid) const {
|
||||
return ::OS::get_singleton()->is_process_running(p_pid);
|
||||
}
|
||||
|
||||
int OS::get_process_id() const {
|
||||
return ::OS::get_singleton()->get_process_id();
|
||||
}
|
||||
|
|
@ -571,6 +575,7 @@ void OS::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("create_instance", "arguments"), &OS::create_instance);
|
||||
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("is_process_running", "pid"), &OS::is_process_running);
|
||||
ClassDB::bind_method(D_METHOD("get_process_id"), &OS::get_process_id);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_environment", "variable"), &OS::get_environment);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue