attributes.c

来自「用c++包装好的线程库,直接拿来使用,提高效率.」· C语言 代码 · 共 29 行

C
29
字号
#include "thread.h"namespace cpp_threads {  //  // attributes - constructor  //  // initialize the attribute structure with default values.  attributes::attributes()  {    Pthread *p = Pthread::self();        if( !p ||  p->inherit() == attr_explicit_e ) {      a_scope       = process_private_e;      a_inherit     = attr_explicit_e;      a_policy      = rrobin_e;      a_state       = attr_joinable_e;    } else {      a_scope       = p->scope();      a_inherit     = p->inherit();      a_policy      = p->policy();      a_state       = p->joinable()?attr_joinable_e:attr_detached_e;    }    a_param.sched_priority = 0;  }}; // namespace

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?