sorry but your code isn't correct in my opinion,
according to the manual:
  if (!GLIB_CHECK_VERSION (1, 2, 0))
    g_error ("GLib version 1.2.0 or above is needed");

so I would remove the "!" since we want to init g_thread if below not above

right?