src/Utility: fix deprecated Thread.create usage (#151)

This commit is contained in:
Yegor Yefremov 2023-03-21 19:05:48 +01:00 committed by GitHub
parent a551387f06
commit 240225d547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@ public abstract class AsyncTask : GLib.Object{
try {
//start thread for reading output stream
Thread.create<void> (read_stdout, true);
new Thread<void>.try ("async-task-stdout-reader", () => {read_stdout();});
} catch (Error e) {
log_error ("AsyncTask.begin():create_thread:read_stdout()");
log_error (e.message);
@ -152,7 +152,7 @@ public abstract class AsyncTask : GLib.Object{
try {
//start thread for reading error stream
Thread.create<void> (read_stderr, true);
new Thread<void>.try ("async-task-stderr-reader", () => {read_stderr();});
} catch (Error e) {
log_error ("AsyncTask.begin():create_thread:read_stderr()");
log_error (e.message);

View File

@ -44,7 +44,7 @@ public class TimeoutCounter : GLib.Object {
try {
active = true;
Thread.create<void> (start_counter_thread, true);
new Thread<void>.try ("timeout-counter",() => { start_counter_thread();});
}
catch (Error e) {
log_error (e.message);
@ -58,7 +58,7 @@ public class TimeoutCounter : GLib.Object {
try {
active = true;
Thread.create<void> (start_counter_thread, true);
new Thread<void>.try ("timeout-counter", () => {start_counter_thread();});
}
catch (Error e) {
log_error (e.message);