1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: Thread creation attributes.</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
</div>
<div class="contents">
<h1>Thread creation attributes.<br>
<small>
[<a class="el" href="group__posix__thread.html">Threads management services.</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Thread creation attributes.:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__posix__threadattr.png" border="0" alt="" usemap="#group____posix____threadattr_map">
<map name="group____posix____threadattr_map">
<area shape="rect" href="group__posix__thread.html" title="Threads management services." alt="" coords="5,5,229,32"></map></td></tr></table></center>
</div>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Thread creation attributes.
<p>
The services described in this section allow to set the attributes of a <b>pthread_attr_t</b> object, passed to the <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a> service in order to set the attributes of a created thread.<p>
A <b>pthread_attr_t</b> object has to be initialized with <a class="el" href="group__posix__threadattr.html#g0b85ebb1e3aac081a4c0a5e85ae3cbe9" title="Initialize a thread attributes object.">pthread_attr_init()</a> first, which sets attributes to their default values, i.e. in kernel-space:<ul>
<li><em>detachstate</em> to PTHREAD_CREATE_JOINABLE,</li><li><em>stacksize</em> to PTHREAD_STACK_MIN,</li><li><em>inheritsched</em> to PTHREAD_EXPLICIT_SCHED,</li><li><em>schedpolicy</em> to SCHED_OTHER,</li><li><em>name</em> to NULL (only available in kernel-space),</li><li>scheduling priority to the minimum,</li><li>floating-point hardware enabled (only available in kernel-space),</li><li>processor affinity set to all available processors (only available as a thread attribute in kernel-space).</li></ul>
<p>
In user-space, the attributes and their defaults values are those documented by the underlying threading library (LinuxThreads or NPTL).
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g0b85ebb1e3aac081a4c0a5e85ae3cbe9">pthread_attr_init</a> (pthread_attr_t *attr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize a thread attributes object. <a href="#g0b85ebb1e3aac081a4c0a5e85ae3cbe9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g4bcdbf47c17c7dcc51e9f05f5cb56d81">pthread_attr_destroy</a> (pthread_attr_t *attr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy a thread attributes object. <a href="#g4bcdbf47c17c7dcc51e9f05f5cb56d81"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g391c34da42e68ddd24f5ee0c070d5c4f">pthread_attr_getdetachstate</a> (const pthread_attr_t *attr, int *detachstate)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get detachstate attribute. <a href="#g391c34da42e68ddd24f5ee0c070d5c4f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#ge6ee78c307d8467b34a9b0c330993a54">pthread_attr_setdetachstate</a> (pthread_attr_t *attr, int detachstate)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set detachstate attribute. <a href="#ge6ee78c307d8467b34a9b0c330993a54"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#ge23600d4670359ab12bfba20db2c9a37">pthread_attr_getstacksize</a> (const pthread_attr_t *attr, size_t *stacksize)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get stacksize attribute. <a href="#ge23600d4670359ab12bfba20db2c9a37"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g812a9a455ae2ef2bb0dca4fff201a281">pthread_attr_setstacksize</a> (pthread_attr_t *attr, size_t stacksize)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set stacksize attribute. <a href="#g812a9a455ae2ef2bb0dca4fff201a281"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g79a77b688c30213e5e52e6be178cde4e">pthread_attr_getinheritsched</a> (const pthread_attr_t *attr, int *inheritsched)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get inheritsched attribute. <a href="#g79a77b688c30213e5e52e6be178cde4e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gd437fe8caa3ef9f0cb7d69f6f6479df9">pthread_attr_setinheritsched</a> (pthread_attr_t *attr, int inheritsched)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set inheritsched attribute. <a href="#gd437fe8caa3ef9f0cb7d69f6f6479df9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gf032906f326f3c209c7eed6bb248ebee">pthread_attr_getschedpolicy</a> (const pthread_attr_t *attr, int *policy)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get schedpolicy attribute. <a href="#gf032906f326f3c209c7eed6bb248ebee"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g79b4c9e71486a87ef3014f1c660b33eb">pthread_attr_setschedpolicy</a> (pthread_attr_t *attr, int policy)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set schedpolicy attribute. <a href="#g79b4c9e71486a87ef3014f1c660b33eb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g8b69613ee83bf326af4b15de5e00ec99">pthread_attr_getschedparam</a> (const pthread_attr_t *attr, struct sched_param *par)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get schedparam attribute. <a href="#g8b69613ee83bf326af4b15de5e00ec99"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gc7026e5a69f8e3a04b03b144392d4df1">pthread_attr_getschedparam_ex</a> (const pthread_attr_t *attr, struct sched_param_ex *par)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get schedparam_ex extended attribute. <a href="#gc7026e5a69f8e3a04b03b144392d4df1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g7d0bf4f0734aca888f89f7341b1df222">pthread_attr_setschedparam</a> (pthread_attr_t *attr, const struct sched_param *par)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set schedparam attribute. <a href="#g7d0bf4f0734aca888f89f7341b1df222"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g981dc55cf19905531309e6a51f0328c3">pthread_attr_setschedparam_ex</a> (pthread_attr_t *attr, const struct sched_param_ex *par)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set extended schedparam_ex attribute. <a href="#g981dc55cf19905531309e6a51f0328c3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gbfd252cd45081231018030e3878efa06">pthread_attr_getscope</a> (const pthread_attr_t *attr, int *scope)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get contention scope attribute. <a href="#gbfd252cd45081231018030e3878efa06"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g294aaacf59f34effeef978242cf08cbe">pthread_attr_setscope</a> (pthread_attr_t *attr, int scope)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set contention scope attribute. <a href="#g294aaacf59f34effeef978242cf08cbe"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gfa30efde4b455077e1b331b93dbd4e3e">pthread_attr_getname_np</a> (const pthread_attr_t *attr, const char **name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get name attribute. <a href="#gfa30efde4b455077e1b331b93dbd4e3e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g4d48205cba54fed0c96dfc0d184b9f88">pthread_attr_setname_np</a> (pthread_attr_t *attr, const char *name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set name attribute. <a href="#g4d48205cba54fed0c96dfc0d184b9f88"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#ga7f2f74cf814982e96418e09ccd2cd93">pthread_attr_getfp_np</a> (const pthread_attr_t *attr, int *fp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the floating point attribute. <a href="#ga7f2f74cf814982e96418e09ccd2cd93"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g3150cd7e9385c6a1b384fb5b515391f5">pthread_attr_setfp_np</a> (pthread_attr_t *attr, int fp)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the floating point attribute. <a href="#g3150cd7e9385c6a1b384fb5b515391f5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#g8f4cd85d9237c8df2320dd386004ee00">pthread_attr_getaffinity_np</a> (const pthread_attr_t *attr, xnarch_cpumask_t *mask)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the processor affinity attribute. <a href="#g8f4cd85d9237c8df2320dd386004ee00"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__threadattr.html#gc79718c596b9cb0fdff961eede1f5995">pthread_attr_setaffinity_np</a> (pthread_attr_t *attr, xnarch_cpumask_t mask)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the processor affinity attribute. <a href="#gc79718c596b9cb0fdff961eede1f5995"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g4bcdbf47c17c7dcc51e9f05f5cb56d81"></a><!-- doxytag: member="thread_attr.c::pthread_attr_destroy" ref="g4bcdbf47c17c7dcc51e9f05f5cb56d81" args="(pthread_attr_t *attr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_destroy </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Destroy a thread attributes object.
<p>
This service invalidates the attribute object pointed to by <em>attr</em>. The object becomes invalid for all services (they all return EINVAL) except <a class="el" href="group__posix__threadattr.html#g0b85ebb1e3aac081a4c0a5e85ae3cbe9" title="Initialize a thread attributes object.">pthread_attr_init()</a>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_destroy.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g8f4cd85d9237c8df2320dd386004ee00"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getaffinity_np" ref="g8f4cd85d9237c8df2320dd386004ee00" args="(const pthread_attr_t *attr, xnarch_cpumask_t *mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getaffinity_np </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">xnarch_cpumask_t * </td>
<td class="paramname"> <em>mask</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the processor affinity attribute.
<p>
This service stores, at the address <em>mask</em>, the value of the <em>affinity</em> attribute in the attribute object <em>attr</em>.<p>
The <em>affinity</em> attributes is a bitmask where bits set indicate processor where a thread created with the attribute <em>attr</em> may run. The least significant bit corresponds to the first logical processor.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>address where the value of the <em>affinity</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="g391c34da42e68ddd24f5ee0c070d5c4f"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getdetachstate" ref="g391c34da42e68ddd24f5ee0c070d5c4f" args="(const pthread_attr_t *attr, int *detachstate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getdetachstate </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>detachstate</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get detachstate attribute.
<p>
This service returns, at the address <em>detachstate</em>, the value of the <em>detachstate</em> attribute in the thread attribute object <em>attr</em>.<p>
Valid values of this attribute are PTHREAD_CREATE_JOINABLE and PTHREAD_CREATE_DETACHED. A detached thread is a thread which control block is automatically reclaimed when it terminates. The control block of a joinable thread, on the other hand, is only reclaimed when joined with the service <a class="el" href="group__posix__thread.html#ga79c99cc7b194918a2def257246f11c6" title="Wait for termination of a specified thread.">pthread_join()</a>.<p>
A thread that was created joinable may be detached after creation by using the <a class="el" href="group__posix__thread.html#g7c275c509c26566b6dd95a2de1668a2f" title="Detach a running thread.">pthread_detach()</a> service.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object</td></tr>
<tr><td valign="top"></td><td valign="top"><em>detachstate</em> </td><td>address where the value of the detachstate attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid;</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getdetachstate.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="ga7f2f74cf814982e96418e09ccd2cd93"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getfp_np" ref="ga7f2f74cf814982e96418e09ccd2cd93" args="(const pthread_attr_t *attr, int *fp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getfp_np </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>fp</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the floating point attribute.
<p>
This service returns, at the address <em>fp</em>, the value of the <em>fp</em> attribute in the attribute object <em>attr</em>.<p>
The <em>fp</em> attribute is a boolean attribute indicating whether a thread created with the attribute <em>attr</em> may use floating-point hardware.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>fp</em> </td><td>address where the value of the <em>fp</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="g79a77b688c30213e5e52e6be178cde4e"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getinheritsched" ref="g79a77b688c30213e5e52e6be178cde4e" args="(const pthread_attr_t *attr, int *inheritsched)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getinheritsched </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>inheritsched</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get inheritsched attribute.
<p>
This service returns at the address <em>inheritsched</em> the value of the <em>inheritsched</em> attribute in the attribute object <em>attr</em>.<p>
Threads created with this attribute set to PTHREAD_INHERIT_SCHED will use the same scheduling policy and priority as the thread calling <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>. Threads created with this attribute set to PTHREAD_EXPLICIT_SCHED will use the value of the <em>schedpolicy</em> attribute as scheduling policy, and the value of the <em>schedparam</em> attribute as scheduling priority.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>inheritsched</em> </td><td>address where the value of the <em>inheritsched</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getinheritsched.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gfa30efde4b455077e1b331b93dbd4e3e"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getname_np" ref="gfa30efde4b455077e1b331b93dbd4e3e" args="(const pthread_attr_t *attr, const char **name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getname_np </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char ** </td>
<td class="paramname"> <em>name</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get name attribute.
<p>
This service stores, at the address <em>name</em>, the value of the <em>name</em> attribute in the attribute object <em>attr</em>.<p>
The <em>name</em> attribute is the name under which a thread created with the attribute object <em>attr</em> will appear under /proc/xenomai/sched.<p>
The name returned by this function is only valid until the name is changed with <a class="el" href="group__posix__threadattr.html#g4d48205cba54fed0c96dfc0d184b9f88" title="Set name attribute.">pthread_attr_setname_np()</a> or the <em>attr</em> object is destroyed with <a class="el" href="group__posix__threadattr.html#g4bcdbf47c17c7dcc51e9f05f5cb56d81" title="Destroy a thread attributes object.">pthread_attr_destroy()</a>.<p>
If <em>name</em> is <em>NULL</em>, a unique default name will be used.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>address where the value of the <em>name</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="g8b69613ee83bf326af4b15de5e00ec99"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getschedparam" ref="g8b69613ee83bf326af4b15de5e00ec99" args="(const pthread_attr_t *attr, struct sched_param *par)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getschedparam </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct sched_param * </td>
<td class="paramname"> <em>par</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get schedparam attribute.
<p>
This service stores, at the address <em>par</em>, the limited form of the <em>schedparam</em> attribute in the attribute object <em>attr</em>.<p>
The limited form only defines the <em>sched_priority</em> member, that is sufficent to hold the scheduling parameter for SCHED_FIFO, SCHED_RR and SCHED_OTHER class members. Threads created with <em>attr</em> will use the value of this attribute as a scheduling priority if the attribute <em>inheritsched</em> is set to PTHREAD_EXPLICIT_SCHED. Valid priorities range from 1 to 99.<p>
<a class="el" href="group__posix__threadattr.html#gc7026e5a69f8e3a04b03b144392d4df1" title="Get schedparam_ex extended attribute.">pthread_attr_getschedparam_ex()</a> should be used to retrieve the parameters for extended scheduling classes, such as SCHED_SPORADIC.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>par</em> </td><td>address where the value of the <em>schedparam</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getschedparam.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gc7026e5a69f8e3a04b03b144392d4df1"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getschedparam_ex" ref="gc7026e5a69f8e3a04b03b144392d4df1" args="(const pthread_attr_t *attr, struct sched_param_ex *par)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getschedparam_ex </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct sched_param_ex * </td>
<td class="paramname"> <em>par</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get schedparam_ex extended attribute.
<p>
This service is an extended version of <a class="el" href="group__posix__threadattr.html#g8b69613ee83bf326af4b15de5e00ec99" title="Get schedparam attribute.">pthread_attr_getschedparam()</a>, that also supports Xenomai-specific or additional POSIX scheduling policies, which are not available with the host Linux environment.<p>
Typically, SCHED_SPORADIC parameters can be retrieved from this call.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>par</em> </td><td>address where the value of the extended <em>schedparam_ex</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getschedparam.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gf032906f326f3c209c7eed6bb248ebee"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getschedpolicy" ref="gf032906f326f3c209c7eed6bb248ebee" args="(const pthread_attr_t *attr, int *policy)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getschedpolicy </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>policy</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get schedpolicy attribute.
<p>
This service stores, at the address <em>policy</em>, the value of the <em>policy</em> attribute in the attribute object <em>attr</em>.<p>
Threads created with the attribute object <em>attr</em> use the value of this attribute as scheduling policy if the <em>inheritsched</em> attribute is set to PTHREAD_EXPLICIT_SCHED. The value of this attribute is one of SCHED_FIFO, SCHED_RR, SCHED_SPORADIC or SCHED_OTHER.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>policy</em> </td><td>address where the value of the <em>policy</em> attribute in the attribute object <em>attr</em> will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getschedpolicy.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gbfd252cd45081231018030e3878efa06"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getscope" ref="gbfd252cd45081231018030e3878efa06" args="(const pthread_attr_t *attr, int *scope)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getscope </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>scope</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get contention scope attribute.
<p>
This service stores, at the address <em>scope</em>, the value of the <em>scope</em> attribute in the attribute object <em>attr</em>.<p>
The <em>scope</em> attribute represents the scheduling contention scope of threads created with the attribute object <em>attr</em>. This implementation only supports the value PTHREAD_SCOPE_SYSTEM.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>scope</em> </td><td>address where the value of the <em>scope</em> attribute will be stored on sucess.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getscope.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="ge23600d4670359ab12bfba20db2c9a37"></a><!-- doxytag: member="thread_attr.c::pthread_attr_getstacksize" ref="ge23600d4670359ab12bfba20db2c9a37" args="(const pthread_attr_t *attr, size_t *stacksize)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_getstacksize </td>
<td>(</td>
<td class="paramtype">const pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"> <em>stacksize</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get stacksize attribute.
<p>
This service stores, at the address <em>stacksize</em>, the value of the <em>stacksize</em> attribute in the attribute object <em>attr</em>.<p>
The <em>stacksize</em> attribute is used as the stack size of the threads created using the attribute object <em>attr</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>stacksize</em> </td><td>address where the value of the <em>stacksize</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_getstacksize.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g0b85ebb1e3aac081a4c0a5e85ae3cbe9"></a><!-- doxytag: member="thread_attr.c::pthread_attr_init" ref="g0b85ebb1e3aac081a4c0a5e85ae3cbe9" args="(pthread_attr_t *attr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_init </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Initialize a thread attributes object.
<p>
This service initializes the thread creation attributes structure pointed to by <em>attr</em>. Attributes are set to their default values (see <a class="el" href="group__posix__threadattr.html">Thread creation attributes.</a>).<p>
If this service is called specifying a thread attributes object that was already initialized, the attributes object is reinitialized.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>address of the thread attributes object to initialize.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0.</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_init.html">Specification.</a> </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="rtcan__rtt_8c-example.html#a18">rtcan_rtt.c</a>.</dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="gc79718c596b9cb0fdff961eede1f5995"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setaffinity_np" ref="gc79718c596b9cb0fdff961eede1f5995" args="(pthread_attr_t *attr, xnarch_cpumask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setaffinity_np </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">xnarch_cpumask_t </td>
<td class="paramname"> <em>mask</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the processor affinity attribute.
<p>
This service sets to <em>mask</em>, the value of the <em>affinity</em> attribute in the attribute object <em>attr</em>.<p>
The <em>affinity</em> attributes is a bitmask where bits set indicate processor where a thread created with the attribute <em>attr</em> may run. The least significant bit corresponds to the first logical processor.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>address where the value of the <em>affinity</em> attribute will be stored on success.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="ge6ee78c307d8467b34a9b0c330993a54"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setdetachstate" ref="ge6ee78c307d8467b34a9b0c330993a54" args="(pthread_attr_t *attr, int detachstate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setdetachstate </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>detachstate</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set detachstate attribute.
<p>
This service sets to <em>detachstate</em> the value of the <em>detachstate</em> attribute in the attribute object <em>attr</em>.<p>
Valid values of this attribute are PTHREAD_CREATE_JOINABLE and PTHREAD_CREATE_DETACHED. A detached thread is a thread which control block is automatically reclaimed when it terminates. The control block of a joinable thread, on the other hand, is only reclaimed when joined with the service <a class="el" href="group__posix__thread.html#ga79c99cc7b194918a2def257246f11c6" title="Wait for termination of a specified thread.">pthread_join()</a>.<p>
A thread that was created joinable may be detached after creation by using the <a class="el" href="group__posix__thread.html#g7c275c509c26566b6dd95a2de1668a2f" title="Detach a running thread.">pthread_detach()</a> service.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>detachstate</em> </td><td>value of the detachstate attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, the attribute object <em>attr</em> is invalid</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setdetachstate.html">Specification.</a> </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="rtcan__rtt_8c-example.html#a19">rtcan_rtt.c</a>.</dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="g3150cd7e9385c6a1b384fb5b515391f5"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setfp_np" ref="g3150cd7e9385c6a1b384fb5b515391f5" args="(pthread_attr_t *attr, int fp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setfp_np </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>fp</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the floating point attribute.
<p>
This service set to <em>fp</em>, the value of the <em>fp</em> attribute in the attribute object <em>attr</em>.<p>
The <em>fp</em> attribute is a boolean attribute indicating whether a thread created with the attribute <em>attr</em> may use floating-point hardware.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>fp</em> </td><td>value of the <em>fp</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="gd437fe8caa3ef9f0cb7d69f6f6479df9"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setinheritsched" ref="gd437fe8caa3ef9f0cb7d69f6f6479df9" args="(pthread_attr_t *attr, int inheritsched)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setinheritsched </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>inheritsched</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set inheritsched attribute.
<p>
This service set to <em>inheritsched</em> the value of the <em>inheritsched</em> attribute in the attribute object <em>attr</em>.<p>
Threads created with this attribute set to PTHREAD_INHERIT_SCHED will use the same scheduling policy and priority as the thread calling <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>. Threads created with this attribute set to PTHREAD_EXPLICIT_SCHED will use the value of the <em>schedpolicy</em> attribute as scheduling policy, and the value of the <em>schedparam</em> attribute as scheduling priority.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>inheritsched</em> </td><td>value of the <em>inheritsched</em> attribute, PTHREAD_INHERIT_SCHED or PTHREAD_EXPLICIT_SCHED.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> or <em>inheritsched</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setinheritsched.html">Specification.</a> </dd></dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="g4d48205cba54fed0c96dfc0d184b9f88"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setname_np" ref="g4d48205cba54fed0c96dfc0d184b9f88" args="(pthread_attr_t *attr, const char *name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setname_np </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>name</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set name attribute.
<p>
This service set to <em>name</em>, the value of the <em>name</em> attribute in the attribute object <em>attr</em>.<p>
The <em>name</em> attribute is the name under which a thread created with the attribute object <em>attr</em> will appear under /proc/xenomai/sched.<p>
If <em>name</em> is <em>NULL</em>, a unique default name will be used.<p>
This service is a non-portable extension of the POSIX interface.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>value of the <em>name</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> is invalid;</li><li>ENOMEM, insufficient memory exists in the system heap to duplicate the name string, increase CONFIG_XENO_OPT_SYS_HEAPSZ.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>kernel module initialization or cleanup routine;</li><li>Xenomai kernel-space thread. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="g7d0bf4f0734aca888f89f7341b1df222"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setschedparam" ref="g7d0bf4f0734aca888f89f7341b1df222" args="(pthread_attr_t *attr, const struct sched_param *par)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setschedparam </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct sched_param * </td>
<td class="paramname"> <em>par</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set schedparam attribute.
<p>
This service set to <em>par</em>, the limited form of the <em>schedparam</em> attribute in the attribute object <em>attr</em>.<p>
The limited form only defines the <em>sched_priority</em> member, that is sufficent to hold the scheduling parameter for SCHED_FIFO, SCHED_RR and SCHED_OTHER class members. Threads created with <em>attr</em> will use the value of this attribute as a scheduling priority if the attribute <em>inheritsched</em> is set to PTHREAD_EXPLICIT_SCHED. Valid priorities range from 1 to 99.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>par</em> </td><td>value of the <em>schedparam</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> or <em>par</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setschedparam.html">Specification.</a> </dd></dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="g981dc55cf19905531309e6a51f0328c3"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setschedparam_ex" ref="g981dc55cf19905531309e6a51f0328c3" args="(pthread_attr_t *attr, const struct sched_param_ex *par)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setschedparam_ex </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct sched_param_ex * </td>
<td class="paramname"> <em>par</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set extended schedparam_ex attribute.
<p>
This service is an extended version of <a class="el" href="group__posix__threadattr.html#g7d0bf4f0734aca888f89f7341b1df222" title="Set schedparam attribute.">pthread_attr_setschedparam()</a>, that also supports Xenomai-specific or additional POSIX scheduling policies, which are not available with the host Linux environment.<p>
Typically, SCHED_SPORADIC parameters can be set using this call.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>par</em> </td><td>value of the <em>schedparam</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> or <em>par</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setschedparam.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g79b4c9e71486a87ef3014f1c660b33eb"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setschedpolicy" ref="g79b4c9e71486a87ef3014f1c660b33eb" args="(pthread_attr_t *attr, int policy)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setschedpolicy </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>policy</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set schedpolicy attribute.
<p>
This service set to <em>policy</em> the value of the <em>policy</em> attribute in the attribute object <em>attr</em>.<p>
Threads created with the attribute object <em>attr</em> use the value of this attribute as scheduling policy if the <em>inheritsched</em> attribute is set to PTHREAD_EXPLICIT_SCHED. The value of this attribute is one of SCHED_FIFO, SCHED_RR, SCHED_SPORADIC or SCHED_OTHER.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>policy</em> </td><td>value of the <em>policy</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> or <em>policy</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setschedpolicy.html">Specification.</a> </dd></dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="g294aaacf59f34effeef978242cf08cbe"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setscope" ref="g294aaacf59f34effeef978242cf08cbe" args="(pthread_attr_t *attr, int scope)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setscope </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>scope</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set contention scope attribute.
<p>
This service set to <em>scope</em> the value of the <em>scope</em> attribute in the attribute object <em>attr</em>.<p>
The <em>scope</em> attribute represents the scheduling contention scope of threads created with the attribute object <em>attr</em>. This implementation only supports the value PTHREAD_SCOPE_SYSTEM.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>scope</em> </td><td>value of the <em>scope</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>ENOTSUP, <em>scope</em> is an unsupported value of the scope attribute.</li><li>EINVAL, <em>attr</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setscope.html">Specification.</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g812a9a455ae2ef2bb0dca4fff201a281"></a><!-- doxytag: member="thread_attr.c::pthread_attr_setstacksize" ref="g812a9a455ae2ef2bb0dca4fff201a281" args="(pthread_attr_t *attr, size_t stacksize)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int pthread_attr_setstacksize </td>
<td>(</td>
<td class="paramtype">pthread_attr_t * </td>
<td class="paramname"> <em>attr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> <em>stacksize</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set stacksize attribute.
<p>
This service set to <em>stacksize</em>, the value of the <em>stacksize</em> attribute in the attribute object <em>attr</em>.<p>
The <em>stacksize</em> attribute is used as the stack size of the threads created using the attribute object <em>attr</em>.<p>
The minimum value for this attribute is PTHREAD_STACK_MIN.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>attr</em> </td><td>attribute object;</td></tr>
<tr><td valign="top"></td><td valign="top"><em>stacksize</em> </td><td>value of the <em>stacksize</em> attribute.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>attr</em> or <em>stacksize</em> is invalid.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_attr_setstacksize.html">Specification.</a> </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="rtcan__rtt_8c-example.html#a20">rtcan_rtt.c</a>.</dl>
<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00119">rt_task_create()</a>.</p>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:40 2010 for Xenomai API by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
|