| 284 | |
| 285 | template<typename TDatums, typename TWorker, typename TQueue> |
| 286 | bool ThreadManager<TDatums, TWorker, TQueue>::tryPush(const TDatums& tDatums) |
| 287 | { |
| 288 | try |
| 289 | { |
| 290 | if (mThreadManagerMode != ThreadManagerMode::Asynchronous |
| 291 | && mThreadManagerMode != ThreadManagerMode::AsynchronousIn) |
| 292 | error("Not available for this ThreadManagerMode.", __LINE__, __FUNCTION__, __FILE__); |
| 293 | if (mTQueues.empty()) |
| 294 | error("ThreadManager already stopped or not started yet.", __LINE__, __FUNCTION__, __FILE__); |
| 295 | return mTQueues[0]->tryPush(tDatums); |
| 296 | } |
| 297 | catch (const std::exception& e) |
| 298 | { |
| 299 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 300 | return false; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | template<typename TDatums, typename TWorker, typename TQueue> |
| 305 | bool ThreadManager<TDatums, TWorker, TQueue>::waitAndPush(const TDatums& tDatums) |