* @brief Sets the scheduling policy and parameters for a thread. * * The `pthread_setschedparam` function sets the scheduling policy and scheduling parameters (such as priority) * for the specified thread. This allows you to control how the thread is scheduled by the operating system. * It is useful for adjusting thread behavior, especially for real-time or performance-sensitive applications.
| 873 | * @see pthread_getschedparam |
| 874 | */ |
| 875 | int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param) |
| 876 | { |
| 877 | _pthread_data_t *ptd; |
| 878 | |
| 879 | ptd = _pthread_get_data(thread); |
| 880 | pthread_attr_setschedpolicy(&ptd->attr, policy); |
| 881 | pthread_attr_setschedparam(&ptd->attr, param); |
| 882 | |
| 883 | return 0; |
| 884 | } |
| 885 | RTM_EXPORT(pthread_setschedparam); |
| 886 | |
| 887 | /** |
nothing calls this directly
no test coverage detected