| 216 | } |
| 217 | |
| 218 | static OSThread* SetEffectivePriority(OSThread* thread, OSPriority priority) |
| 219 | { |
| 220 | switch (thread->state) |
| 221 | { |
| 222 | case OS_THREAD_STATE_READY: |
| 223 | UnsetRun(thread); |
| 224 | thread->priority = priority; |
| 225 | SetRun(thread); |
| 226 | break; |
| 227 | case OS_THREAD_STATE_WAITING: |
| 228 | RemoveItem(thread->queue, thread, link); |
| 229 | thread->priority = priority; |
| 230 | AddPrio(thread->queue, thread, link); |
| 231 | if (thread->mutex) |
| 232 | { |
| 233 | return thread->mutex->thread; |
| 234 | } |
| 235 | break; |
| 236 | case OS_THREAD_STATE_RUNNING: |
| 237 | RunQueueHint = TRUE; |
| 238 | thread->priority = priority; |
| 239 | break; |
| 240 | } |
| 241 | return NULL; |
| 242 | } |
| 243 | |
| 244 | inline void UpdatePriority(OSThread* thread) |
| 245 | { |
no test coverage detected