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