src/components/sde/sde.c
// Initialize library handle, or return the existing one if already
// initialized. This function is _not_ thread safe, so it needs to be called
// from within regions protected by papi_sde_lock()/papi_sde_unlock().
Initialize library handle, or return the existing one if already
initialized. This function is _not_ thread safe, so it needs to be called
from within regions protected by papi_sde_lock()/papi_sde_unlock().
Initialize library handle or return the existing one if already initialized . This function is _not_ thread safe so it needs to be called from within regions protected by papi_sde_lock () / papi_sde_unlock () .
static papi_handle_t 
do_sde_init(const char *name_of_library)
{
    papisde_control_t* gctl;
    papisde_library_desc_t *tmp_lib;
    SUBDBG("Registering library: '%s'\n",name_of_library);
    gctl = get_global_struct();
    tmp_lib = find_library_by_name(name_of_library, gctl);
    if( NULL != tmp_lib ){
        return tmp_lib;
    }
    tmp_lib = ( papisde_library_desc_t* ) papi_calloc( 1, sizeof( papisde_library_desc_t ) );
    tmp_lib->libraryName = strdup(name_of_library);
    insert_library_handle(tmp_lib, gctl);
    return tmp_lib;
}
static papi_handle_t do_sde_init ( const char * name_of_library ) { papisde_control_t * gctl ; papisde_library_desc_t * tmp_lib ; SUBDBG ( " \n " , name_of_library ) ; gctl = get_global_struct ( ) ; tmp_lib = find_library_by_name ( name_of_library , gctl ) ; if ( NULL != tmp_lib ) { return tmp_lib ; } tmp_lib = ( papisde_library_desc_t * ) papi_calloc ( 1 , sizeof ( papisde_library_desc_t ) ) ; tmp_lib -> libraryName = strdup ( name_of_library ) ; insert_library_handle ( tmp_lib , gctl ) ; return tmp_lib ; }
Initialize library handle, or return the existing one if already
initialized.
Initialize library handle or return the existing one if already initialized .
// If the library is already initialized, return the handle to it // If the library is not already initialized, then initialize it.