コード例 #1
0
ファイル: hwstub.cpp プロジェクト: aozima/rockbox
error handle::get_log(void *buf, size_t& buf_sz)
{
    std::unique_lock<std::recursive_mutex> lock(m_mutex);
    /* get a pointer so that it's not destroyed during the runtime of the function,
     * the pointer will be released at the end of the function */
    std::shared_ptr<context> ctx = m_dev->get_context();
    if(!ctx)
        return error::NO_CONTEXT;
    /* ensure valid status */
    error err = status();
    if(err != error::SUCCESS)
        return err;
    return get_dev_log(buf, buf_sz);
}
コード例 #2
0
ファイル: hwstub_virtual.cpp プロジェクト: Rockbox/rockbox
error handle::get_dev_log(void *buf, size_t& buf_sz)
{
    auto p = m_hwdev.lock();
    return p ? p->get_dev_log(buf, buf_sz) : error::DISCONNECTED;
}