Use statically-allocated thread private data
[projects/chimara/chimara.git] / libchimara / chimara-glk.c
index 337cfa5fce112326e50b4349b0b696c8bb050b6e..a350c5aa0442bd35dd5dcb9aff389fa567eedd4a 100644 (file)
@@ -1128,8 +1128,8 @@ glk_main() runs. Takes ownership of @startup and will free it. */
 static gpointer
 glk_enter(struct StartupData *startup)
 {
-       extern GPrivate *glk_data_key;
-       g_private_set(glk_data_key, startup->glk_data);
+       extern GPrivate glk_data_key;
+       g_private_set(&glk_data_key, startup->glk_data);
 
        /* Acquire the Glk thread's references to the input queues */
        g_async_queue_ref(startup->glk_data->char_input_queue);
@@ -1236,8 +1236,8 @@ chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GE
        g_object_notify(G_OBJECT(glk), "program-name");
        
     /* Run in a separate thread */
-       priv->thread = g_thread_create((GThreadFunc)glk_enter, startup, TRUE, error);
-       
+       priv->thread = g_thread_try_new("glk", (GThreadFunc)glk_enter, startup, error);
+
        return !(priv->thread == NULL);
 }