• E
    threads: add one-time initialization support · 99de5990
    Eric Blake 提交于
    mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the
    best we can do is portably expose once-only runtime initialization.
    
    * src/util/threads.h (virOnceControlPtr): New opaque type.
    (virOnceFunc): New callback type.
    (virOnce): New prototype.
    * src/util/threads-pthread.h (virOnceControl): Declare.
    (VIR_ONCE_CONTROL_INITIALIZER): Define.
    * src/util/threads-win32.h (virOnceControl)
    (VIR_ONCE_CONTROL_INITIALIZER): Likewise.
    * src/util/threads-pthread.c (virOnce): Implement in pthreads.
    * src/util/threads-win32.c (virOnce): Implement in WIN32.
    * src/libvirt_private.syms: Export it.
    99de5990
libvirt_private.syms 20.8 KB