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

Function sys_sched_getscheduler

components/lwp/lwp_syscall.c:8983–9001  ·  view source on GitHub ↗

* @brief Get the scheduling policy of a thread. * * This function retrieves the current scheduling policy of the specified thread. * * @param[in] tid The thread ID of the target thread. * * @return sysret_t Returns the scheduling policy of the thread on success. On failure, * returns a negative error code. * * @note The caller must have appropriate permissions to query th

Source from the content-addressed store, hash-verified

8981 * of the specified thread.
8982 */
8983sysret_t sys_sched_getscheduler(int tid)
8984{
8985 rt_thread_t thread = RT_NULL;
8986 int rtn;
8987
8988 thread = lwp_tid_get_thread_and_inc_ref(tid);
8989 lwp_tid_dec_ref(thread);
8990
8991 if (thread)
8992 {
8993 rtn = SCHED_RR;
8994 }
8995 else
8996 {
8997 rtn = -ESRCH;
8998 }
8999
9000 return rtn;
9001}
9002
9003/**
9004 * @brief Flush the file descriptors' data to disk.

Callers

nothing calls this directly

Calls 2

lwp_tid_dec_refFunction · 0.85

Tested by

no test coverage detected