This is the sorter functor for the task-queue. */
| 176 | |
| 177 | /** This is the sorter functor for the task-queue. */ |
| 178 | struct CTaskSorter |
| 179 | { |
| 180 | bool operator()(const CThreadScheduler::CEntryPair& a, const CThreadScheduler::CEntryPair& b) { |
| 181 | if (a.first->GetPriority() != b.first->GetPriority()) { |
| 182 | return a.first->GetPriority() > b.first->GetPriority(); |
| 183 | } |
| 184 | |
| 185 | // Compare tasks numbers. |
| 186 | return a.second < b.second; |
| 187 | } |
| 188 | }; |
| 189 | |
| 190 | |
| 191 |