Skip to content
  • Philip Withnall's avatar
    genviron: Message if g_setenv()/g_unsetenv() are used after threads spawned · 120e6435
    Philip Withnall authored
    
    
    g_setenv() and g_unsetenv() can never be thread-safe, so emit a message if
    they are used after any threads have been spawned.
    
    This can’t catch interactions between setenv() and g_thread_new(), or
    between g_setenv() and pthread_create(), but it’ll catch most
    misbehaviour in GLib-centric code.
    
    Currently, the message is a `g_debug()` call. Eventually, I’d like to
    upgrade it to a `g_warning()`, but there are a number of GLib tests
    which call g_setenv() after threads have been created, and they need to
    be fixed first. Emitting a `g_debug()` message gives people an
    opportunity to start fixing their code.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    
    Helps: #715
    120e6435