openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/regexp.c
static perthread_regex_t* create_perthread_regex(const regex_t* preg,
                                                 uncomp_regex_t* uncomp)
{
    perthread_regex_t* entry = NULL;

    if (Debug)
    {
        DBGPRINTF("Creating new regex_t for thread %p original regexp_t %p "
                  "(pattern: %s, cflags: %x)\n",
                  (void*)pthread_self(), preg, uncomp->regex, uncomp->cflags);
    }
    entry = calloc(1, sizeof(*entry));
    if (!entry)
        return entry;
    entry->original_preg = preg;
    DBGPRINTF("regexp: regcomp %p %p\n", entry, &entry->preg);
    entry->ret = regcomp(&entry->preg, uncomp->regex, uncomp->cflags);
    pthread_mutex_init(&entry->lock, NULL);
    entry->thread = pthread_self();
    return entry;
}
// Create a copy of preg to be used by this thread only.
Create a copy of preg to be used by this thread only.
Create a copy of preg to be used by this thread only .
static perthread_regex_t* create_perthread_regex(const regex_t* preg,
                                                 uncomp_regex_t* uncomp)
{
    perthread_regex_t* entry = NULL;
    if (Debug)
    {
        DBGPRINTF("Creating new regex_t for thread %p original regexp_t %p "
                  "(pattern: %s, cflags: %x)\n",
                  (void*)pthread_self(), preg, uncomp->regex, uncomp->cflags);
    }
    entry = calloc(1, sizeof(*entry));
    if (!entry)
        return entry;
    entry->original_preg = preg;
    DBGPRINTF("regexp: regcomp %p %p\n", entry, &entry->preg);
    entry->ret = regcomp(&entry->preg, uncomp->regex, uncomp->cflags);
    pthread_mutex_init(&entry->lock, NULL);
    entry->thread = pthread_self();
    return entry;
}
static perthread_regex_t * create_perthread_regex ( const regex_t * preg , uncomp_regex_t * uncomp ) { perthread_regex_t * entry = NULL ; if ( Debug ) { DBGPRINTF ( " " " \n " , ( void * ) pthread_self ( ) , preg , uncomp -> regex , uncomp -> cflags ) ; } entry = calloc ( 1 , sizeof ( * entry ) ) ; if ( ! entry ) return entry ; entry -> original_preg = preg ; DBGPRINTF ( " \n " , entry , & entry -> preg ) ; entry -> ret = regcomp ( & entry -> preg , uncomp -> regex , uncomp -> cflags ) ; pthread_mutex_init ( & entry -> lock , NULL ) ; entry -> thread = pthread_self ( ) ; return entry ; }
Create a copy of preg to be used by this thread only.
Create a copy of preg to be used by this thread only .