| 97 | // ---------------------------------------------------------------------------------------- |
| 98 | |
| 99 | threader:: |
| 100 | ~threader ( |
| 101 | ) |
| 102 | { |
| 103 | data_mutex.lock(); |
| 104 | destruct = true; |
| 105 | data_ready.broadcast(); |
| 106 | |
| 107 | // wait for all the threads to end |
| 108 | while (total_count > 0) |
| 109 | destructed.wait(); |
| 110 | |
| 111 | thread_pool_has_been_destroyed = true; |
| 112 | data_mutex.unlock(); |
| 113 | } |
| 114 | |
| 115 | // ---------------------------------------------------------------------------------------- |
| 116 |