| 6 | namespace rtc { |
| 7 | class Thread; |
| 8 | } |
| 9 |
| 10 | namespace tgcalls { |
| 11 |
| 12 | class Threads { |
| 13 | public: |
| 14 | virtual ~Threads() = default; |
| 15 | virtual rtc::Thread *getNetworkThread() = 0; |
| 16 | virtual rtc::Thread *getMediaThread() = 0; |
| 17 | virtual rtc::Thread *getWorkerThread() = 0; |
| 18 |
| 19 | // it is not possible to decrease pool size |
| 20 | static void setPoolSize(size_t size); |
| 21 | static std::shared_ptr<Threads> getThreads(); |
| 22 | }; |
| 23 |
| 24 | namespace StaticThreads { |
| 25 | rtc::Thread *getNetworkThread(); |
| 26 | rtc::Thread *getMediaThread(); |
| 27 | rtc::Thread *getWorkerThread(); |
| 28 | std::shared_ptr<Threads> &getThreads(); |
| 29 | } |
| 30 |
| 31 | }; |
| 32 |