| 16 | class ExecutorScopeMultiThreadTest : public MNNTestCase { |
| 17 | public: |
| 18 | virtual bool run(int precision) { |
| 19 | std::vector<std::thread> threads; |
| 20 | for (int i = 0; i < 4; ++i) { |
| 21 | threads.emplace_back([&]() { |
| 22 | ExecutorScope scope(ExecutorScope::Current()); |
| 23 | }); |
| 24 | } |
| 25 | for (auto& t : threads) { |
| 26 | t.join(); |
| 27 | } |
| 28 | return true; |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | MNNTestSuiteRegister(ExecutorScopeMultiThreadTest, "expr/ExecutorScopeMultiThread"); |