| 477 | { |
| 478 | public: |
| 479 | CThreadError() |
| 480 | { |
| 481 | pthread_key_create(&m_ThreadSpecKey, ThreadSpecKeyDestroy); |
| 482 | |
| 483 | // This is a global object and as such it should be called in the |
| 484 | // main application thread or at worst in the thread that has first |
| 485 | // run `srt_startup()` function and so requested the SRT library to |
| 486 | // be dynamically linked. Most probably in this very thread the API |
| 487 | // errors will be reported, so preallocate the ThreadLocalSpecific |
| 488 | // object for this error description. |
| 489 | |
| 490 | // This allows std::bac_alloc to crash the program during |
| 491 | // the initialization of the SRT library (likely it would be |
| 492 | // during the DL constructor, still way before any chance of |
| 493 | // doing any operations here). This will prevent SRT from running |
| 494 | // into trouble while trying to operate. |
| 495 | CUDTException* ne = new CUDTException(); |
| 496 | pthread_setspecific(m_ThreadSpecKey, ne); |
| 497 | } |
| 498 | |
| 499 | ~CThreadError() |
| 500 | { |
nothing calls this directly
no outgoing calls
no test coverage detected