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

Function pthread_setschedprio

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

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

Source from the content-addressed store, hash-verified

914 * @see pthread_setschedparam, pthread_getschedparam
915 */
916int 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, &param);
924
925 return 0;
926}
927RTM_EXPORT(pthread_setschedprio);
928
929/**

Callers

nothing calls this directly

Calls 2

_pthread_get_dataFunction · 0.85

Tested by

no test coverage detected