美文网首页
S版本 HAL层 子线程使用

S版本 HAL层 子线程使用

作者: Ed_Lannister | 来源:发表于2022-05-07 14:29 被阅读0次

    .h头文件函数声明

      void dump_frame_thread();
      std::thread mDumpFrameThread;
    

    cpp 头文件引用

    #include <pthread.h>
    

    函数主体

    void HWCDisplayBuiltIn::dump_frame_thread(){
      pthread_setname_np(pthread_self(), "dump_frame_thread");
      ALOGE("ELHWC dump_frame_thread xxxxxxxxxxxxxxxxxxxxxxxxxxxxx run %s,LINE=%d ", __FUNCTION__,__LINE__);
    }
    

    调用子线程

    HWC2::Error HWCDisplayBuiltIn::SetFrameDumpConfig(uint32_t count, uint32_t bit_mask_layer_type,
                                                      int32_t format, bool post_processed) {
    long timestart = getNowTime();
    ALOGE("ELHWC %s mDumpFrameThread , while count =%d, bit_mask_layertype=%d, HAL_PIXEL_FORMAT_RGB_888 format =%d, post_processed=true,LINE=%d",
                       __FUNCTION__,count, bit_mask_layer_type, format,__LINE__);
    
    mDumpFrameThread = std::thread(&HWCDisplayBuiltIn::dump_frame_thread, this);
    
    if(mDumpFrameThread.joinable()){
        ALOGE("ELHWC detach mDumpFrameThread %s,LINE=%d", __FUNCTION__,__LINE__);
        mDumpFrameThread.detach();
    }
    

    相关文章

      网友评论

          本文标题:S版本 HAL层 子线程使用

          本文链接:https://www.haomeiwen.com/subject/iscxurtx.html