title: How to use future / async in cppyy
body: <p>I'm trying to use <code>future</code> from C++ STL via cppyy (a C++-python binding packet).
  <br> For example, I could run this following code in C++ (which is adapted from this <a href="https://stackoverflow.com/a/17204246/11122122">answer</a>)</p>
  <pre><code>#include &lt;future&gt;
  #include &lt;thread&gt;
  #include &lt;chrono&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace chrono_literals; 
  
  int main () {
      promise&lt;int&gt; p;
      future&lt;int&gt; f = p.get_future();
      thread t([&amp;p]() {
          this_thread::sleep_for(10s);
          p.set_value(2);
      });
      auto status = f.wait_for(10ms);
      if (status == future_status::ready) {
          cout &lt;&lt; &quot;task is read&quot; &lt;&lt; endl;
      } else {
          cout &lt;&lt; &quot;task is running&quot; &lt;&lt; endl;
      }
      t.join();
      return 0;
  }
  </code></pre>
  <p>A similar implementation of the above in Python is</p>
  <pre><code>import cppyy
  
  cppyy.cppdef(r'''
  #include &lt;future&gt;
  #include &lt;thread&gt;
  #include &lt;chrono&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int test () {
      promise&lt;int&gt; p;
      future&lt;int&gt; f = p.get_future();
      thread t([&amp;p]() {
          this_thread::sleep_for(10s);
          p.set_value(2);
      });
      auto status = f.wait_for(10ms);
      if (status == future_status::ready) {
          cout &lt;&lt; &quot;task is read&quot; &lt;&lt; endl;
      } else {
          cout &lt;&lt; &quot;task is running&quot; &lt;&lt; endl;
      }
      t.join();
      return 0;
  }
  ''')
  
  
  cppyy.gbl.test()
  </code></pre>
  <p>And the above code yields</p>
  <pre><code>IncrementalExecutor::executeFunction: symbol '__emutls_v._ZSt15__once_callable' unresolved while linking symbol '__cf_4'!
  IncrementalExecutor::executeFunction: symbol '__emutls_v._ZSt11__once_call' unresolved while linking symbol '__cf_4'!
  </code></pre>
  <p>It looks like it's caused by using <code>future</code> in cppyy.
  Any solutions to this?</p>