Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. [myViewController performSelectorOnMainThread : @ selector(show_myButton) withObject:nil waitUntilDone:YES];
  2.  
  3. void ObjectiveCPlusPlusInterface::startMyThread(void* a, myObject* b)
  4. {
  5. boost::thread AVPlayerThread = boost::thread(&ObjectiveCPlusPlusInterface::myThreadFunction, this, a, b);
  6. }
  7.  
  8. void ObjectiveCPlusPlusInterface::myThreadFunction(void* a, myObject* b)
  9. {
  10. ...
  11. }
  12.  
  13. try
  14. {
  15. boost::thread AVPlayerThread(&ObjectiveCPlusPlusInterface::myThread, this, a, b);
  16.  
  17. AVPlayerThread.detach(); // or join()?
  18. }
  19. catch (boost::thread_resource_error const &)
  20. {
  21. // resource error (print a diagnostic!)
  22. }
  23. catch (...)
  24. {
  25. // some other exception (print a diagnostic!)
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement