| 98 | } |
| 99 | |
| 100 | bool ThreadPool::removeWithTag( const Uint64& tag ) { |
| 101 | std::vector<Uint64> ids; |
| 102 | { |
| 103 | std::unique_lock<std::mutex> lock( mMutex ); |
| 104 | for ( const auto& work : mWork ) |
| 105 | if ( work->tag == tag ) |
| 106 | ids.emplace_back( work->id ); |
| 107 | } |
| 108 | for ( const auto& id : ids ) |
| 109 | removeId( id ); |
| 110 | return !ids.empty(); |
| 111 | } |
| 112 | |
| 113 | Uint64 ThreadPool::run( const std::function<void()>& func, |
| 114 | const std::function<void( const Uint64& )>& doneCallback, |
no test coverage detected