• Earle F. Philhower, III's avatar
    Make mutexes init in DATA, not ((counstructor)) (#645) · 11300077
    Earle F. Philhower, III authored
    There was a race condition in making mutexes that were only init in
    an __attribute((constructor)) code block.  For example, a global
    object might do a `malloc` in its constructor which would depend on
    the malloc mutex...which may not yet have been initted.
    
    Make them initted in the .data section, instead, which is guaranteed
    good before any global constructors are called.
    11300077
lock.c 2.71 KB