Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. int sa2a(int n)
  2. {
  3. assert(n > 0);
  4.  
  5. int nn = (n / 100) + 99-(n % 100);
  6. if (nn == 0)
  7. nn = 1;
  8. return f1(nn, 4);
  9. }
  10.  
  11. thread t0(sa2a, 10);
  12.  
  13. auto future = std::async(std::launch::async, &sa2a, 10);
  14. // do some other stuff
  15. int result = future.get(); // wait on async completion and get result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement