MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pthread_setschedparam

Function pthread_setschedparam

components/libc/posix/pthreads/pthread.c:875–884  ·  view source on GitHub ↗

* @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.

Source from the content-addressed store, hash-verified

873 * @see pthread_getschedparam
874 */
875int 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}
885RTM_EXPORT(pthread_setschedparam);
886
887/**

Callers

nothing calls this directly

Calls 3

_pthread_get_dataFunction · 0.85

Tested by

no test coverage detected