Merge pull request #45315 from RandomShaper/modernize_thread

Modernize Thread
This commit is contained in:
Rémi Verschelde 2021-01-31 15:24:56 +01:00 committed by GitHub
commit 5525cd85c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 385 additions and 1056 deletions

View file

@ -74,13 +74,12 @@ void JoypadLinux::Joypad::reset() {
JoypadLinux::JoypadLinux(Input *in) {
exit_udev = false;
input = in;
joy_thread = Thread::create(joy_thread_func, this);
joy_thread.start(joy_thread_func, this);
}
JoypadLinux::~JoypadLinux() {
exit_udev = true;
Thread::wait_to_finish(joy_thread);
memdelete(joy_thread);
joy_thread.wait_to_finish();
close_joypad();
}