华大基因如何优化其网站以吸引中国疾控中心的关注?

摘要:华大基因 网站建设,中国疾控中心最新发布,专业网站建设制作价格,北京app搭建公司目录 线程的声明 线程创建过程 向线程中投递消息 从消息队列中取消息的具体实现 处理线程消息 webrtc线程模块的实现逻辑在 rtc_basethread
华大基因 网站建设,中国疾控中心最新发布,专业网站建设制作价格,北京app搭建公司目录 线程的声明 线程创建过程 向线程中投递消息 从消息队列中取消息的具体实现 处理线程消息 webrtc线程模块的实现逻辑在 rtc_base\thread.h 文件中 比如想创建一个线程#xff1a; //声明要创建的线程指针#xff0c;通过智能指针管理 std::unique_ptrrtc::Thr…目录 线程的声明 线程创建过程 向线程中投递消息 从消息队列中取消息的具体实现 处理线程消息 webrtc线程模块的实现逻辑在 rtc_base\thread.h 文件中 比如想创建一个线程 //声明要创建的线程指针通过智能指针管理 std::unique_ptrrtc::Thread video_thread_; // 创建线程 video_thread_ rtc::Thread::Create(); //设置新创建的线程名 video_thread_-SetName(video_thread_, video_thread_.get()); //开启线程 video_thread_-Start(); //向线程投递要处理的消息video_thread_-Post(RTC_FROM_HERE, this, MESSAGE_ID);// MESSAGE_ID 自定义的消息id//向线程投入带有消息体的消息video_thread_-Post(RTC_FROM_HERE, this, VIDEO_INFO,new rtc::TypedMessageDataVIDEO_INFO_MEESAGE(r));//其中RTC_FROM_HERE 是个宏定义标记线程调用的原位置 // Define a macro to record the current source location. #define RTC_FROM_HERE RTC_FROM_HERE_WITH_FUNCTION(__FUNCTION__) 下面看下线程的具体实现 线程的声明 //线程继承自一个任务队列并且有两个存储消息的消息队列 //普通消息 messages_延时消息 delayed_messages_ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {explicit Thread(SocketServer* ss);explicit Thread(std::unique_ptrSocketServer ss);privateMessage msgPeek_;//声明对应的消息//MessageList 具体的定义//typedef std::listMessage MessageList;MessageList messages_ RTC_GUARDED_BY(crit_); //延时队列继承自 std::priority_queueDelayedMessage PriorityQueue delayed_messages_ RTC_GUARDED_BY(crit_); uint32_t delayed_next_num_ RTC_GUARDED_BY(crit_); } 创建线程的实现 //具体的创建函数 //构造中传入一个 NullSocketServer() 作为参数 std::unique_ptrThread Thread::Create() {return std::unique_ptrThread(new Thread(std::unique_ptrSocketServer(new NullSocketServer()))); }//最终调用到这里线程构造函数 Thread::Thread(SocketServer* ss, bool do_init): fPeekKeep_(false),delayed_next_num_(0),fInitialized_(false),fDestroyed_(false),stop_(0),ss_(ss) {RTC_DCHECK(ss);//把当前线程的this指针传给 NullSocketServerss_-SetMessageQueue(this); //设置线程的初始名字SetName(Thread, this); // default nameif (do_init) {DoInit();} }void Thread::DoInit() {if (fInitialized_) {return;}fInitialized_ true;//把当前线程的this指针对象传给ThreadManag
阅读全文