Remove unnecessary call to the deprecated g_thread_init().
g_thread_init() has been deprecated since glib 2.32. This CL removes the
unnecessary call to g_thread_init(), so that we can later migrate to
glib 2.34. It also replaces dbus_g_thread_init(), which calls the
deprecated g_thread_supported(), with dbus_threads_init_default()
directly.
BUG=chromium:253025
TEST=Tested the following:
1. Build and run unit tests.
2. Run trybot builds on x86, amd64, and arm platforms.
Change-Id: I30852f1d3525f3d7b5b6cd756d18c2816a28903f
Reviewed-on: https://gerrit.chromium.org/gerrit/59801
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
diff --git a/generate_delta_main.cc b/generate_delta_main.cc
index 1f49c42..d7de1ab 100644
--- a/generate_delta_main.cc
+++ b/generate_delta_main.cc
@@ -287,7 +287,6 @@
}
int Main(int argc, char** argv) {
- g_thread_init(NULL);
google::ParseCommandLineFlags(&argc, &argv, true);
CommandLine::Init(argc, argv);
Terminator::Init();
diff --git a/main.cc b/main.cc
index b045793..345d6e1 100644
--- a/main.cc
+++ b/main.cc
@@ -149,8 +149,7 @@
int main(int argc, char** argv) {
::g_type_init();
- g_thread_init(NULL);
- dbus_g_thread_init();
+ dbus_threads_init_default();
base::AtExitManager exit_manager; // Required for base/rand_util.h.
chromeos_update_engine::Terminator::Init();
chromeos_update_engine::Subprocess::Init();
diff --git a/testrunner.cc b/testrunner.cc
index aa75495..139de75 100644
--- a/testrunner.cc
+++ b/testrunner.cc
@@ -19,8 +19,7 @@
int main(int argc, char **argv) {
LOG(INFO) << "started";
::g_type_init();
- g_thread_init(NULL);
- dbus_g_thread_init();
+ dbus_threads_init_default();
base::AtExitManager exit_manager;
// TODO(garnold) temporarily cause the unittest binary to exit with status
// code 2 upon catching a SIGTERM. This will help diagnose why the unittest
diff --git a/update_engine_client.cc b/update_engine_client.cc
index b4a4bda..87b1615 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -4,6 +4,7 @@
#include <string>
+#include <dbus/dbus.h>
#include <gflags/gflags.h>
#include <glib.h>
@@ -287,8 +288,7 @@
int main(int argc, char** argv) {
// Boilerplate init commands.
g_type_init();
- g_thread_init(NULL);
- dbus_g_thread_init();
+ dbus_threads_init_default();
chromeos_update_engine::Subprocess::Init();
google::ParseCommandLineFlags(&argc, &argv, true);