質問編集履歴
3
追記
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -6,7 +6,10 @@ | |
| 6 6 |  | 
| 7 7 | 
             
            void th (int n) {
         | 
| 8 8 | 
             
             try {
         | 
| 9 | 
            +
              for () {
         | 
| 9 | 
            -
             | 
| 10 | 
            +
                 /*処理*/
         | 
| 11 | 
            +
                 /*これだと例外発生後にthreadが停止する??*/
         | 
| 12 | 
            +
              }
         | 
| 10 13 | 
             
             }
         | 
| 11 14 | 
             
             catch (AException &a) {
         | 
| 12 15 | 
             
              /*エラー時の処理*/
         | 
2
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -28,8 +28,11 @@ | |
| 28 28 | 
             
            int main () {
         | 
| 29 29 | 
             
             try {
         | 
| 30 30 | 
             
              std::thread thread1(th, 1);
         | 
| 31 | 
            -
              std::thread  | 
| 31 | 
            +
              std::thread thread2(th, 2);
         | 
| 32 | 
            -
              std::thread  | 
| 32 | 
            +
              std::thread thread3(th, 3);
         | 
| 33 | 
            +
              thread1.join();
         | 
| 34 | 
            +
              thread2.join();
         | 
| 35 | 
            +
              thread3.join();
         | 
| 33 36 | 
             
             }
         | 
| 34 37 | 
             
             catch (std::exception &e) {
         | 
| 35 38 | 
             
              /*エラー時の処理*/
         | 
1
修正
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -27,7 +27,9 @@ | |
| 27 27 |  | 
| 28 28 | 
             
            int main () {
         | 
| 29 29 | 
             
             try {
         | 
| 30 | 
            -
             | 
| 30 | 
            +
              std::thread thread1(th, 1);
         | 
| 31 | 
            +
              std::thread thread1(th, 2);
         | 
| 32 | 
            +
              std::thread thread1(th, 3);
         | 
| 31 33 | 
             
             }
         | 
| 32 34 | 
             
             catch (std::exception &e) {
         | 
| 33 35 | 
             
              /*エラー時の処理*/
         | 
| @@ -38,4 +40,7 @@ | |
| 38 40 | 
             
            }
         | 
| 39 41 |  | 
| 40 42 |  | 
| 41 | 
            -
            ```
         | 
| 43 | 
            +
            ```
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            AExceptionを意図的に発生させた際に、発生させたスレッドが停止してしまいます
         | 
| 46 | 
            +
            どうすれば停止せずに続けられますか?
         |