pthread_setschedprio()函数详解!!!

 

pthread_setschedprio()

Set a thread's priority 用于设置现成的优先级

包含在头文件

#include <pthread.h>
用法:
int pthread_setschedprio( pthread_t thread, int prio );
thread是你想要修改的线程的线程id;
prio 是你将要修改成的优先级

如果线程正在运行或运行,就绪队列中的位置对其的影响取决于修改的方向:

如果你提高优先级,线程成为优先级的就绪队列的尾部。

如果你不改变优先级,线程不会改变位置在就绪队列中。

如果你降低优先级,线程成为这个优先级就绪队列的头。

 

Returns:

EOK    Success. 
EINVAL The priority isn't valid for the scheduling policy of the specified thread.
ENOTSUP The specified priority isn't supported.
EPERM The calling thread doesn't have sufficient privileges to modify the specified thread's priority.
ESRCH Invalid thread ID thread

 

转载于:https://www.cnblogs.com/splovecyk/p/4500645.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值