void log_close(int sink) {
    /* prevent changing the mode while logging */
    CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_LOG_MODE]);
#if !defined(USE_WIN32) && !defined(__vms)
    if(sink&SINK_SYSLOG)
        syslog_close();
#endif
    if(sink&SINK_OUTFILE)
        outfile_close();
    CRYPTO_THREAD_unlock(stunnel_locks[LOCK_LOG_MODE]);
}
void log_close(int sink) {
     
    CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_LOG_MODE]);
#if !defined(USE_WIN32) && !defined(__vms)
    if(sink&SINK_SYSLOG)
        syslog_close();
#endif
    if(sink&SINK_OUTFILE)
        outfile_close();
    CRYPTO_THREAD_unlock(stunnel_locks[LOCK_LOG_MODE]);
}