<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                boost::thread庫提供了以下三種線程啟動方式: 1)、最簡單的方式 ~~~ // BoostThread.cpp : 定義控制臺應用程序的入口點。 // #include "stdafx.h" #include <iostream> #include <boost/thread.hpp> void thread_fun(std::string s) { std::cout<<"thread parameter:"<<s<<std::endl; std::cout<<"I am a thread!!!"<<std::endl; } int _tmain(int argc, _TCHAR* argv[]) { boost::thread thrd(thread_fun,"hello"); thrd.join(); getchar(); return 0; } ~~~ 2)、用struct結構operator成員函數來啟動 ~~~ #include "stdafx.h" #include <iostream> #include <boost/thread.hpp> struct callable { callable(std::string parameter):parameter(parameter){} void operator()() { std::cout<<"thread parameter:"<<parameter<<std::endl; std::cout<<"I am a thread!!!"<<std::endl; } std::string parameter; }; int _tmain(int argc, _TCHAR* argv[]) { boost::thread thrd1(callable("hello1")); boost::thread thrd2(callable("hello2")); thrd1.join(); thrd2.join(); getchar(); return 0; } ~~~ 3)、以成員函數方式啟動線程 ~~~ #include "stdafx.h" #include <iostream> #include <boost/thread.hpp> class ThreadClass { public: void fun(const std::string ?meter) { std::cout<<"thread parameter:"<<parameter<<std::endl; std::cout<<"I am a thread!!!"<<std::endl; } }; int _tmain(int argc, _TCHAR* argv[]) { ThreadClass obj; boost::thread thrd1(boost::bind(&ThreadClass::fun,&obj,"hello1")); boost::thread thrd2(boost::bind(&ThreadClass::fun,&obj,"hello2")); thrd1.join(); thrd2.join(); getchar(); return 0; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看