当前位置: 首页 > news >正文

做视频网站需要什么服务器配置做网站头片的高清图

做视频网站需要什么服务器配置,做网站头片的高清图,创业ppt模板免费,怎么自己免费做网站使用 condition_variable::wait(unique_lockmutexlck, Predicate pred) 时#xff0c;必须保证条件变量通过notify唤醒的同时#xff0c;wait 的第二个参数 Predicate 返回 true 了才可以往下走。必须两个条件同时满足#xff0c;如果notify的时候Predicate返回… 使用 condition_variable::wait(unique_lockmutexlck, Predicate pred) 时必须保证条件变量通过notify唤醒的同时wait 的第二个参数 Predicate 返回 true 了才可以往下走。必须两个条件同时满足如果notify的时候Predicate返回时false一样的唤不醒线程。 #include iostream #include future #include chrono #include string #includefunctional #include queueusing Task std::functionvoid(); class ThreaPool { public:void start() {running_ true;}bool is_running(){return running_;}void stop() {std::cout stop... std::endl;running_ false;std::unique_lockstd::mutex lk(qmutext_);tasks_.push([]() { std::cout hello pool end std::endl;  });cond_.notify_all();}void push_task(Task task) {if (!running_){return;}std::unique_lockstd::mutex lk(qmutext_);tasks_.push(task);cond_.notify_one();}ThreaPool(int count){for (int i 0; i count; i){pool_.emplace_back([this]() {while (true){Task task;{std::unique_lockstd::mutex lk(qmutext_);std::cout wait 1 std::endl;cond_.wait(lk, [this] {return !running_ || !tasks_.empty(); });std::cout wait 2 std::endl;if (!tasks_.empty()){task std::move(tasks_.front());tasks_.pop();}}if (task){task();}if (!this-is_running()){std::cout stoped 1 std::endl;std::unique_lockstd::mutex lk(qmutext_);if (tasks_.empty()) {std::cout stoped 2 std::endl;return;}}}});}}~ThreaPool() {for (std::thread worker : pool_) {worker.join();}};private:std::vectorstd::thread pool_;std::mutex qmutext_;std::condition_variable cond_;std::queue Task tasks_;std::atomic_bool running_{ true }; };int main() {ThreaPool pool(5);std::this_thread::sleep_for(std::chrono::seconds(1));pool.push_task([]() { std::cout hello pool 1 \n std::endl; });pool.push_task([]() { std::cout hello pool 2 \n std::endl; });pool.push_task([]() { std::cout hello pool 3 \n std::endl; });pool.push_task([]() { std::cout hello pool 4 \n std::endl; });pool.push_task([]() { std::cout hello pool 5 \n std::endl; });pool.push_task([]() { std::cout hello pool 6 \n std::endl; });pool.push_task([]() { std::cout hello pool 7 \n std::endl; });pool.push_task([]() { std::cout hello pool 8 \n std::endl; });pool.push_task([]() { std::cout hello pool 9 \n std::endl; });std::this_thread::sleep_for(std::chrono::seconds(1));pool.stop();return 0; }
http://www.w-s-a.com/news/923267/

相关文章:

  • 理县网站建设公司郑州仿站定制模板建站
  • 手机网站建设网站报价诸城人才网招聘网
  • 一起做网站怎么下单临沂网站制作
  • 公司网站案例企业网站 模版
  • 做的好的响应式网站有哪些网站界面设计案例
  • 上海创意型网站建设icp备案网站信息
  • 网站没收录中山手机网站制作哪家好
  • 代驾软件开发流程wordpress 博客主题 seo
  • 成都的教育品牌网站建设网站广告js代码添加
  • 网站找人做seo然后网站搜不到了网站建设seoppt
  • 做网站优化有用吗学做文案的网站
  • wordpress 知名网站怎么做微网站
  • 用电脑怎么做原创视频网站河南建设工程信息网一体化平台官网
  • 云服务器和网站空间郑州做招商的网站
  • 规模以上工业企业的标准北京seo结算
  • 软件开发过程模型如何做网站性能优化
  • 网站建站公司广州南京江北新区楼盘
  • 哪些做展架图的网站好开发公司2022年工作计划
  • 磨床 东莞网站建设wordpress下载类主题系统主题
  • 免费学编程网站芜湖做网站都有哪些
  • 能发外链的网站门户网站网页设计规范
  • 网站建设所需人力南城区网站建设公司
  • 网站做图尺寸大小手机模板网站模板下载网站有哪些内容
  • 德阳市建设管理一体化平台网站做美食网站
  • 怎么做自己的推广网站2024年瘟疫大爆发
  • vps正常网站打不开linux网站建设
  • 福州网站快速排名在一个网站的各虚拟目录中默认文档的文件名要相同
  • 网站开发 流程图网站开发用哪个linux
  • 怎么用自己电脑做服务器发布网站吗seo门户网价格是多少钱
  • 备案网站可以做影视站网站400