thread_attributes.h
上传用户:shtangtang
上传日期:2007-01-04
资源大小:167k
文件大小:1k
源码类别:
Linux/Unix编程
开发平台:
Unix_Linux
- #ifndef __THREADS_ATTRIBUTES_H
- #define __THREADS_ATTRIBUTES_H
- extern "C" {
- # include <sched.h>
- };
- /**
- * Thread attributes. These can be used to change the policy
- * of a thread, and clones.
- */
- struct attributes {
- enum scope {
- process_shared,
- process_private
- };
- enum inheritance {
- attr_inherit,
- attr_explicit
- };
- enum state {
- attr_joinable,
- attr_detached
- };
- enum policy {
- other = SCHED_OTHER,
- fifo = SCHED_FIFO,
- rrobin = SCHED_RR
- };
- scope a_scope;
- inheritance a_inherit;
- state a_state;
- policy a_policy;
- struct sched_param a_param;
- attributes();
- };
- #endif /* THREADS ATTRIBUTES */