* @brief Sets the scheduling priority for a thread. * * The `pthread_setschedprio` function adjusts the priority of the specified thread while leaving its * scheduling policy unchanged. This is useful for fine-tuning thread behavior in multithreaded applications. * * @param[in] thread * The thread whose scheduling priority is to be changed. This must be a valid `pthread_t` identifier. *
| 914 | * @see pthread_setschedparam, pthread_getschedparam |
| 915 | */ |
| 916 | int pthread_setschedprio(pthread_t thread, int prio) |
| 917 | { |
| 918 | _pthread_data_t *ptd; |
| 919 | struct sched_param param; |
| 920 | |
| 921 | ptd = _pthread_get_data(thread); |
| 922 | param.sched_priority = prio; |
| 923 | pthread_attr_setschedparam(&ptd->attr, ¶m); |
| 924 | |
| 925 | return 0; |
| 926 | } |
| 927 | RTM_EXPORT(pthread_setschedprio); |
| 928 | |
| 929 | /** |
nothing calls this directly
no test coverage detected