Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. /samefile say P.cpp
  2. // in somefunction
  3. void send_msg( bla .. bla ..)
  4. {
  5. bla ..bla...
  6. if( client_mine ) //
  7. {
  8.  
  9. std::cout <<" We are in client_mine stmt " // this statement always get printed even just before crashing
  10. try
  11. {
  12. Answer_thread answer_thread( *client_mine );
  13. bla ..
  14. bla..
  15. bla,,
  16. }
  17. catch(...)
  18. {
  19. std::cout << " Never get caught here " ;
  20. }
  21. }
  22. }
  23. //in same file
  24. class Answer_thread
  25. {
  26. public:
  27.  
  28. Answer_thread( Client_Mine& client_mine )
  29. : client_mine_( client )
  30. , thread_( boost::ref( *this ) )
  31. , sleep_int_( 2250 )
  32. {
  33. std::cout <<" When application crashes .. i never get printed out " ;
  34. }
  35.  
  36. private:
  37. Client_Mine& client_mine_;
  38. boost::thread thread_;
  39. string answer_;
  40. int sleep_int_;
  41. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement