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/obj.c
static rsRetVal ReleaseObj(const char* srcFile, uchar* pObjName,
                           uchar* pObjFile, interface_t* pIf)
{
    DEFiRet;
    objInfo_t* pObjInfo;

    /* dev debug only dbgprintf("source file %s releasing object '%s',
    ifIsLoaded %d\n", srcFile, pObjName, pIf->ifIsLoaded); */
    pthread_mutex_lock(&mutObjGlobalOp);

    if (pObjFile == NULL)
        FINALIZE; /* if it is not a lodable module, we do not need to do
                     anything... */

    if (pIf->ifIsLoaded == 0)
    {
        FINALIZE; /* we are not loaded - this is perfectly OK... */
    }
    else if (pIf->ifIsLoaded == 2)
    {
        pIf->ifIsLoaded = 0; /* clean up */
        FINALIZE; /* we had a load error and can not/must not continue */
    }

    CHKiRet(FindObjInfo((const char*)pObjName, &pObjInfo));

    /* if we reach this point, we have a valid pObjInfo */
    module.Release(srcFile, &pObjInfo->pModInfo); /* decrease refcount */

    pIf->ifIsLoaded = 0; /* indicated "no longer valid" */

finalize_it:
    pthread_mutex_unlock(&mutObjGlobalOp);

    RETiRet;
}
/* This function shall be called when a caller is done with an object. Its
 * primary purpose is to keep the reference count correct, which is highly
 * important for modules residing in loadable modules. rgerhards, 2008-03-10
 */
This function shall be called when a caller is done with an object. Its
primary purpose is to keep the reference count correct, which is highly
important for modules residing in loadable modules.
This function shall be called when a caller is done with an object . Its primary purpose is to keep the reference count correct which is highly important for modules residing in loadable modules .
static rsRetVal ReleaseObj(const char* srcFile, uchar* pObjName,
                           uchar* pObjFile, interface_t* pIf)
{
    DEFiRet;
    objInfo_t* pObjInfo;
    pthread_mutex_lock(&mutObjGlobalOp);
    if (pObjFile == NULL)
        FINALIZE; 
    if (pIf->ifIsLoaded == 0)
    {
        FINALIZE; 
    }
    else if (pIf->ifIsLoaded == 2)
    {
        pIf->ifIsLoaded = 0; 
        FINALIZE; 
    }
    CHKiRet(FindObjInfo((const char*)pObjName, &pObjInfo));
    module.Release(srcFile, &pObjInfo->pModInfo); 
    pIf->ifIsLoaded = 0; 
finalize_it:
    pthread_mutex_unlock(&mutObjGlobalOp);
    RETiRet;
}
static rsRetVal ReleaseObj ( const char * srcFile , uchar * pObjName , uchar * pObjFile , interface_t * pIf ) { DEFiRet ; objInfo_t * pObjInfo ; pthread_mutex_lock ( & mutObjGlobalOp ) ; if ( pObjFile == NULL ) FINALIZE ; if ( pIf -> ifIsLoaded == 0 ) { FINALIZE ; } else if ( pIf -> ifIsLoaded == 2 ) { pIf -> ifIsLoaded = 0 ; FINALIZE ; } CHKiRet ( FindObjInfo ( ( const char * ) pObjName , & pObjInfo ) ) ; module . Release ( srcFile , & pObjInfo -> pModInfo ) ; pIf -> ifIsLoaded = 0 ; finalize_it : pthread_mutex_unlock ( & mutObjGlobalOp ) ; RETiRet ; }
This function shall be called when a caller is done with an object.
This function shall be called when a caller is done with an object .
/* dev debug only dbgprintf("source file %s releasing object '%s',
    ifIsLoaded %d\n", srcFile, pObjName, pIf->ifIsLoaded); */ /* if it is not a lodable module, we do not need to do
                     anything... */ /* we are not loaded - this is perfectly OK... */ /* clean up */ /* we had a load error and can not/must not continue */ /* if we reach this point, we have a valid pObjInfo */ /* decrease refcount */ /* indicated "no longer valid" */