framework/src/fwk_multi_thread.c
static struct __fwk_thread_ctx *thread_get_ctx(fwk_id_t id)
{
    struct fwk_module_ctx *module_ctx;
    struct fwk_element_ctx *element_ctx;

    if (fwk_module_is_valid_element_id(id)) {
        element_ctx = fwk_module_get_element_ctx(id);
        if (element_ctx->thread_ctx != NULL) {
            return element_ctx->thread_ctx;
        } else {
            id = FWK_ID_MODULE(id.element.module_idx);
        }
    }

    if (fwk_module_is_valid_module_id(id)) {
        module_ctx = fwk_module_get_ctx(id);
        return (module_ctx->thread_ctx != NULL) ?
               module_ctx->thread_ctx : &ctx.common_thread_ctx;
    }

    return NULL;
}
/*
 * Get the thread context of a given module or element.
 *
 * \param id Module or element identifier.
 *
 * \return Thread context, NULL if the identifier is not valid.
 */
Get the thread context of a given module or element.
\param id Module or element identifier.

\return Thread context, NULL if the identifier is not valid.
Get the thread context of a given module or element . \ param id Module or element identifier . \ return Thread context NULL if the identifier is not valid .
static struct __fwk_thread_ctx *thread_get_ctx(fwk_id_t id)
{
    struct fwk_module_ctx *module_ctx;
    struct fwk_element_ctx *element_ctx;
    if (fwk_module_is_valid_element_id(id)) {
        element_ctx = fwk_module_get_element_ctx(id);
        if (element_ctx->thread_ctx != NULL) {
            return element_ctx->thread_ctx;
        } else {
            id = FWK_ID_MODULE(id.element.module_idx);
        }
    }
    if (fwk_module_is_valid_module_id(id)) {
        module_ctx = fwk_module_get_ctx(id);
        return (module_ctx->thread_ctx != NULL) ?
               module_ctx->thread_ctx : &ctx.common_thread_ctx;
    }
    return NULL;
}
static struct __fwk_thread_ctx * thread_get_ctx ( fwk_id_t id ) { struct fwk_module_ctx * module_ctx ; struct fwk_element_ctx * element_ctx ; if ( fwk_module_is_valid_element_id ( id ) ) { element_ctx = fwk_module_get_element_ctx ( id ) ; if ( element_ctx -> thread_ctx != NULL ) { return element_ctx -> thread_ctx ; } else { id = FWK_ID_MODULE ( id . element . module_idx ) ; } } if ( fwk_module_is_valid_module_id ( id ) ) { module_ctx = fwk_module_get_ctx ( id ) ; return ( module_ctx -> thread_ctx != NULL ) ? module_ctx -> thread_ctx : & ctx . common_thread_ctx ; } return NULL ; }
Get the thread context of a given module or element.
Get the thread context of a given module or element .