| 18 | |
| 19 | #ifdef __APPLE__ |
| 20 | void *IOThread::threadMain() { |
| 21 | terminated.store(false); |
| 22 | stopping.store(false); |
| 23 | try { |
| 24 | run(); |
| 25 | } |
| 26 | catch (...) { |
| 27 | terminated.store(true); |
| 28 | stopping.store(true); |
| 29 | throw; |
| 30 | } |
| 31 | |
| 32 | terminated.store(true); |
| 33 | stopping.store(true); |
| 34 | return this; |
| 35 | }; |
| 36 | |
| 37 | void *IOThread::pthread_helper(void *context) { |
| 38 | return ((IOThread *) context)->threadMain(); |