GLib.Thread.init
Description: Reference for GLib.Thread.init

### Function

# GLib Threadinit

deprecated: 2.32

#### Declaration [src]

    void
    g_thread_init (
      gpointer vtable
    )

#### Description [src]

If you use GLib from more than one thread, you must initialize the thread system by calling g_thread_init().

Since version 2.24, calling `g_thread_init()` multiple times is allowed, but nothing happens except for the first call.

Since version 2.32, GLib does not support custom thread implementations anymore and the `vtable` parameter is ignored and you should pass `NULL`.

Note

`g_thread_init()` must not be called directly or indirectly in a callback from GLib. Also no mutexes may be currently locked while calling g_thread_init().

Note

To use `g_thread_init()` in your program, you have to link with the libraries that the command `pkg-config --libs gthread-2.0` outputs. This is not the case for all the other thread-related functions of GLib. Those can be used without having to link with the thread libraries.

Deprecated since: 2.32

This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.

This function is not directly available to language bindings.

#### Parameters

`vtable`

  Type: `gpointer`

  A function table of type `GThreadFunctions`, that provides the entry points to the thread system to be used. Since 2.32, this parameter is ignored and should always be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.