Edit

IABSD.fr/src/lib/libc/thread/rthread_debug.c

Branch :

  • Show log

    Commit

  • Author : guenther
    Date : 2017-09-05 02:40:54
    Hash : a5511fa9
    Message : Move mutex, condvar, and thread-specific data routes, pthread_once, and pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@

  • lib/libc/thread/rthread_debug.c
  • /* $OpenBSD: rthread_debug.c,v 1.3 2017/09/05 02:40:54 guenther Exp $ */
    
    /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
    
    #include <pthread.h>
    #include <stdarg.h>
    #include <stdio.h>
    #include <unistd.h>
    
    #include "rthread.h"
    
    /*
     * format and send output to stderr if the given "level" is less than or
     * equal to the current debug level.   Messages with a level <= 0 will
     * always be printed.
     */
    void
    _rthread_debug(int level, const char *fmt, ...)
    {
    	if (_rthread_debug_level >= level) {
    		va_list ap;
    		va_start(ap, fmt);
    		vdprintf(STDERR_FILENO, fmt, ap);
    		va_end(ap);
    	}
    }
    DEF_STRONG(_rthread_debug);