whats wrong with this??

Qt Code:
  1. #include <iostream>
  2. #include <QThread>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. class Th1 : public QThread
  8. {
  9. public:
  10. void run()
  11. {
  12. while (true)
  13. {
  14. cout << "X" << endl;
  15. msleep(500);
  16. }
  17. }
  18. };
  19.  
  20.  
  21. class Th2 : public QThread
  22. {
  23. public:
  24.  
  25. void run()
  26. {
  27. while (true)
  28. {
  29. cout << "Y" << endl;
  30. msleep(500);
  31. }
  32. }
  33. };
  34.  
  35.  
  36. int main(int argc, char *argv[])
  37. {
  38. Th1 *t = new Th1();
  39. t->start();
  40.  
  41. Th2 *h = new Th2();
  42. h->start();
  43. //h->run();
  44. }
To copy to clipboard, switch view to plain text mode 

when i uncomment the last statement, it works...
im confused.