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