blob: 72fe87ff08ff7ef0e50894a3229cac0c539aff37 [file] [log] [blame]
<!--
Documentation/_templates/layout.html
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. The
ASF licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pthread Interfaces &mdash; NuttX latest documentation</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/tabs.css" type="text/css" />
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
<link rel="shortcut icon" href="../../_static/favicon.ico"/>
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Environment Variables" href="09_env_vars.html" />
<link rel="prev" title="Signal Interfaces" href="07_signals.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home"> NuttX
<img src="../../_static/NuttX.png" class="logo" alt="Logo"/>
</a>
<!-- this version selector is quite ugly, should be probably replaced by something
more modern -->
<div class="version-selector">
<select onchange="javascript:location.href = this.value;">
<option value="../../../latest" selected="selected">latest</option>
<option value="../../../10.0.0" >10.0.0</option>
<option value="../../../10.0.1" >10.0.1</option>
<option value="../../../10.1.0" >10.1.0</option>
<option value="../../../10.2.0" >10.2.0</option>
<option value="../../../10.3.0" >10.3.0</option>
<option value="../../../11.0.0" >11.0.0</option>
<option value="../../../12.0.0" >12.0.0</option>
<option value="../../../12.1.0" >12.1.0</option>
<option value="../../../12.2.0" >12.2.0</option>
<option value="../../../12.2.1" >12.2.1</option>
<option value="../../../12.3.0" >12.3.0</option>
<option value="../../../12.4.0" >12.4.0</option>
<option value="../../../12.5.0" >12.5.0</option>
<option value="../../../12.5.1" >12.5.1</option>
<option value="../../../12.6.0" >12.6.0</option>
<option value="../../../12.7.0" >12.7.0</option>
<option value="../../../12.8.0" >12.8.0</option>
<option value="../../../12.9.0" >12.9.0</option>
<option value="../../../12.10.0" >12.10.0</option>
<option value="../../../12.11.0" >12.11.0</option>
</select>
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Table of Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../introduction/index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../quickstart/index.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing/index.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../platforms/index.html">Supported Platforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../components/index.html">OS Components</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../applications/index.html">Applications</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">API Reference</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Userspace API</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="01_task_control.html">Task Control Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="02_task_scheduling.html">Task Scheduling Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="03_task_control.html">Task Control Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="04_message_queue.html">Named Message Queue Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="05_counting_semaphore.html">Counting Semaphore Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="06_clocks_timers.html">Clocks and Timers</a></li>
<li class="toctree-l3"><a class="reference internal" href="07_signals.html">Signal Interfaces</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Pthread Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="09_env_vars.html">Environment Variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="10_filesystem.html">File System Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="11_network.html">Network Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="12_shared_memory.html">Shared Memory Interfaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="13_boardctl.html">Board IOCTL</a></li>
<li class="toctree-l3"><a class="reference internal" href="13_logging.html">Logging</a></li>
<li class="toctree-l3"><a class="reference internal" href="structures.html">OS Data Structures</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../os/index.html">Architecture APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../faq/index.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guides/index.html">Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">NuttX</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="../index.html">API Reference</a> &raquo;</li>
<li><a href="index.html">Userspace API</a> &raquo;</li>
<li>Pthread Interfaces</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/reference/user/08_pthread.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pthread-interfaces">
<h1>Pthread Interfaces<a class="headerlink" href="#pthread-interfaces" title="Permalink to this headline"></a></h1>
<p>NuttX does not support <em>processes</em> in the way that, say, Linux does.
NuttX only supports simple threads or tasks running within the same
address space. However, NuttX does support the concept of a <em>task
group</em>. A task group is the functional analog of a process: It is a
group that consists of the main task thread and of all of the pthreads
created by the main thread or any of the other pthreads within the task
group. Members of a task group share certain resources such as
environment variables, file descriptors, <code class="docutils literal notranslate"><span class="pre">FILE</span></code> streams, sockets,
pthread keys and open message queues.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Behavior of features related to task groups depend of NuttX
configuration settings. See also the<a class="reference external" href="https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Tasking">NuttX
Tasking</a>page
and the<a class="reference external" href="https://cwiki.apache.org/confluence/display/NUTTX/Tasks+vs.+Threads+FAQ">Tasks vs. Threads
FAQ</a>for
additional information on tasks and threads in NuttX.</p>
</div>
<p>The following pthread interfaces are supported in some form by NuttX:</p>
<p><strong>pthread control interfaces</strong>. Interfaces that allow you to create and
manage pthreads.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_attr_init" title="pthread_attr_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_destroy" title="pthread_attr_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_setschedpolicy" title="pthread_attr_setschedpolicy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_setschedpolicy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_getschedpolicy" title="pthread_attr_getschedpolicy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_getschedpolicy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_setschedparam" title="pthread_attr_setschedparam"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_setschedparam()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_getschedparam" title="pthread_attr_getschedparam"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_getschedparam()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_setinheritsched" title="pthread_attr_setinheritsched"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_setinheritsched()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_getinheritsched" title="pthread_attr_getinheritsched"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_getinheritsched()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_setstacksize" title="pthread_attr_setstacksize"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_setstacksize()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_attr_getstacksize" title="pthread_attr_getstacksize"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_attr_getstacksize()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_create" title="pthread_create"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_create()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_detach" title="pthread_detach"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_detach()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_exit" title="pthread_exit"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_exit()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cancel" title="pthread_cancel"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cancel()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_setcancelstate" title="pthread_setcancelstate"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_setcanceltype" title="pthread_setcanceltype"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_setcanceltype()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_testcancel" title="pthread_testcancel"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_testcancel()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cleanup_pop" title="pthread_cleanup_pop"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cleanup_pop()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cleanup_push" title="pthread_cleanup_push"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cleanup_push()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_join" title="pthread_join"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_join()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_yield" title="pthread_yield"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_yield()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_self" title="pthread_self"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_self()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_getschedparam" title="pthread_getschedparam"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_getschedparam()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_setschedparam" title="pthread_setschedparam"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>Thread Specific Data</strong>. These interfaces can be used to create pthread
<em>keys</em> and then to access thread-specific data using these keys. Each
<em>task group</em> has its own set of pthread keys. NOTES: (1) pthread keys
create in one <em>task group</em> are not accessible in other task groups. (2)
The main task thread does not have thread-specific data.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_key_create" title="pthread_key_create"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_key_create()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_setspecific" title="pthread_setspecific"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_getspecific" title="pthread_getspecific"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_getspecific()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_key_delete" title="pthread_key_delete"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_key_delete()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>pthread Mutexes</strong>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_mutexattr_init" title="pthread_mutexattr_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_destroy" title="pthread_mutexattr_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_getpshared" title="pthread_mutexattr_getpshared"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_getpshared()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_setpshared" title="pthread_mutexattr_setpshared"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_setpshared()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_gettype" title="pthread_mutexattr_gettype"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_gettype()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_settype" title="pthread_mutexattr_settype"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_settype()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_getprotocol" title="pthread_mutexattr_getprotocol"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_getprotocol()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutexattr_setprotocol" title="pthread_mutexattr_setprotocol"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutexattr_setprotocol()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_init" title="pthread_mutex_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_destroy" title="pthread_mutex_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_lock" title="pthread_mutex_lock"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_lock()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_timedlock" title="pthread_mutex_timedlock"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_timedlock()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_trylock" title="pthread_mutex_trylock"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_trylock()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_mutex_unlock" title="pthread_mutex_unlock"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_mutex_unlock()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>Condition Variables</strong>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_condattr_init" title="pthread_condattr_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_condattr_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_condattr_destroy" title="pthread_condattr_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_condattr_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_init" title="pthread_cond_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_destroy" title="pthread_cond_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_broadcast" title="pthread_cond_broadcast"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_broadcast()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_signal" title="pthread_cond_signal"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_signal()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_wait" title="pthread_cond_wait"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_wait()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_cond_timedwait" title="pthread_cond_timedwait"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_cond_timedwait()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>Barriers</strong>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_barrierattr_init" title="pthread_barrierattr_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrierattr_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrierattr_destroy" title="pthread_barrierattr_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrierattr_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrierattr_setpshared" title="pthread_barrierattr_setpshared"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrierattr_setpshared()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrierattr_getpshared" title="pthread_barrierattr_getpshared"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrierattr_getpshared()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrier_init" title="pthread_barrier_init"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrier_destroy" title="pthread_barrier_destroy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrier_destroy()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_barrier_wait" title="pthread_barrier_wait"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>Initialization</strong>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_once" title="pthread_once"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_once()</span></code></a></p></li>
</ul>
</div></blockquote>
<p><strong>Signals</strong>.</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="#c.pthread_kill" title="pthread_kill"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_kill()</span></code></a></p></li>
<li><p><a class="reference internal" href="#c.pthread_sigmask" title="pthread_sigmask"><code class="xref c c-func docutils literal notranslate"><span class="pre">pthread_sigmask()</span></code></a></p></li>
</ul>
</div></blockquote>
<p>No support for the following pthread interfaces is provided by NuttX:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_atfork</span></code>. register fork handlers.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getdetachstate</span></code>. get and set the detachstate
attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getguardsize</span></code>. get and set the thread guardsize
attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getinheritsched</span></code>. get and set the inheritsched
attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getscope</span></code>. get and set the contentionscope attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getstack</span></code>. get and set stack attributes.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_getstackaddr</span></code>. get and set the stackaddr attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_setdetachstate</span></code>. get and set the detachstate
attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_setguardsize</span></code>. get and set the thread guardsize
attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_setscope</span></code>. get and set the contentionscope attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_setstack</span></code>. get and set stack attributes.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_attr_setstackaddr</span></code>. get and set the stackaddr attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_condattr_getclock</span></code>. set the clock selection condition
variable attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_condattr_getpshared</span></code>. get the process-shared condition
variable attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_condattr_setclock</span></code>. set the clock selection condition
variable attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_condattr_setpshared</span></code>. set the process-shared condition
variable attribute.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_getconcurrency</span></code>. get and set the level of concurrency.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_getcpuclockid</span></code>. access a thread CPU-time clock.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_mutex_getprioceiling</span></code>. get and set the priority ceiling of
a mutex.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_mutex_setprioceiling</span></code>. get and set the priority ceiling of
a mutex.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_mutex_timedlock</span></code>. lock a mutex.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_getprioceiling</span></code>. get and set the prioceiling
attribute of the mutex attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_setprioceiling</span></code>. get and set the prioceiling
attribute of the mutex attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_rwlockattr_destroy</span></code>. destroy and initialize the read-write
lock attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_rwlockattr_getpshared</span></code>. get and set the process-shared
attribute of the read-write lock attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_rwlockattr_init</span></code>. destroy and initialize the read-write
lock attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_rwlockattr_setpshared</span></code>. get and set the process-shared
attribute of the read-write lock attributes object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_setconcurrency</span></code>. get and set the level of concurrency.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_spin_destroy</span></code>. destroy or initialize a spin lock object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_spin_init</span></code>. destroy or initialize a spin lock object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_spin_lock</span></code>. lock a spin lock object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_spin_trylock</span></code>. lock a spin lock object.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_spin_unlock</span></code>. unlock a spin lock object.</p></li>
</ul>
</div></blockquote>
<dl class="c function">
<dt id="c.pthread_attr_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_init</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_init" title="Permalink to this definition"></a><br /></dt>
<dd><p>Initializes a thread attributes object (attr) with
default values for all of the individual attributes used by the
implementation.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_init()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_destroy</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p>An attributes object can be deleted when it is no
longer needed.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_destroy()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_setschedpolicy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_setschedpolicy</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">policy</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_setschedpolicy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_setschedpolicy()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_getschedpolicy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_getschedpolicy</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">FAR</span> <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">policy</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_getschedpolicy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_getschedpolicy()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_setschedparam">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_setschedparam</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.sched_param" title="sched_param"><span class="pre">sched_param</span></a> <span class="pre">*</span><em><span class="pre">param</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_setschedparam" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_getschedpolicy()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_getschedparam">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_getschedparam</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.sched_param" title="sched_param"><span class="pre">sched_param</span></a> <span class="pre">*</span><em><span class="pre">param</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_getschedparam" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_getschedparam()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_setinheritsched">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_setinheritsched</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">inheritsched</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_setinheritsched" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_setinheritsched()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_getinheritsched">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_getinheritsched</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">inheritsched</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_getinheritsched" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_getinheritsched()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_setstacksize">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_setstacksize</span></code><span class="sig-paren">(</span><span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">long</span> <em><span class="pre">stacksize</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_setstacksize" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_setstacksize()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_attr_getstacksize">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_attr_getstacksize</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">FAR</span> <a class="reference internal" href="structures.html#c.size_t" title="size_t"><span class="pre">size_t</span></a> <span class="pre">*</span><em><span class="pre">stackaddr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_attr_getstacksize" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_attr_getstacksize()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_create">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_create</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <span class="pre">*</span><em><span class="pre">thread</span></em>, <span class="pre">pthread_attr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">pthread_startroutine_t</span> <em><span class="pre">startRoutine</span></em>, <span class="pre">pthread_addr_t</span> <em><span class="pre">arg</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>To create a thread object and runnable thread, a
routine must be specified as the new thread’s start routine. An argument
may be passed to this routine, as an untyped address; an untyped address
may also be returned as the routine’s value. An attributes object may be
used to specify details about the kind of thread being created.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_create()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_detach">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_detach</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_detach" title="Permalink to this definition"></a><br /></dt>
<dd><p>A thread object may be “detached” to specify that the
return value and completion status will not be requested.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_detach()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_exit">
<span class="pre">void</span> <code class="sig-name descname"><span class="pre">pthread_exit</span></code><span class="sig-paren">(</span><span class="pre">pthread_addr_t</span> <em><span class="pre">pvValue</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_exit" title="Permalink to this definition"></a><br /></dt>
<dd><p>A thread may terminate it’s own execution.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_exit()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cancel">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cancel</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cancel" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_cancel()</span></code> function will request that thread be canceled.
The target thread’s cancellability state, enabled, or disabled,
determines when the cancellation takes effect: When the cancellation is
acted on, thread will be terminated. When cancellability is disabled,
all cancellations are held pending in the target thread until the thread
re-enables cancellability.</p>
<p>The target thread’s cancellability state determines how the cancellation
is acted on: Either asynchronously or deferred. Asynchronous
cancellations will be acted upon immediately (when enabled),
interrupting the thread with its processing in an arbitrary state.</p>
<p>When cancellability is deferred, all cancellations are held pending in
the target thread until the thread changes the cancellability type or a
<a class="reference external" href="https://cwiki.apache.org/confluence/display/NUTTX/Cancellation+Points">Cancellation
Point</a>
function such as <code class="docutils literal notranslate"><span class="pre">`pthread_testcancel()</span></code> &lt;#pthreadtestcancel&gt;`__ is
entered.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>thread</strong> – Identifies the thread to be canceled.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cancel()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ESRCH</span></code>. No thread could be found corresponding to that specified
by the given thread ID.</p></li>
</ul>
</p>
</dd>
</dl>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name. Except:</p>
<ul class="simple">
<li><p>The thread-specific data destructor functions will not be called for
the thread. These destructors are not currently supported.</p></li>
</ul>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_setcancelstate">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_setcancelstate</span></code><span class="sig-paren">(</span><span class="pre">int</span> <em><span class="pre">state</span></em>, <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">oldstate</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_setcancelstate" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code> function atomically sets both the
calling thread’s cancellability state to the indicated state and returns
the previous cancellability state at the location referenced by
oldstate. Legal values for state are PTHREAD_CANCEL_ENABLE and
PTHREAD_CANCEL_DISABLE.</p>
<p>Any pending thread cancellation may occur at the time that the
cancellation state is set to PTHREAD_CANCEL_ENABLE.</p>
<p><strong>Input Parameters:</strong></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>state</strong> – New cancellation state. One of PTHREAD_CANCEL_ENABLE or
PTHREAD_CANCEL_DISABLE.</p></li>
<li><p><strong>oldstate</strong> – Location to return the previous cancellation state.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ESRCH</span></code>. No thread could be found corresponding to that specified
by the given thread ID.</p></li>
</ul>
</p>
</dd>
</dl>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_setcanceltype">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_setcanceltype</span></code><span class="sig-paren">(</span><span class="pre">int</span> <em><span class="pre">type</span></em>, <span class="pre">FAR</span> <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">oldtype</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_setcanceltype" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_setcanceltype()</span></code> function atomically
both sets the calling thread’s cancellability type to the indicated type
and returns the previous cancellability type at the location referenced
by <code class="docutils literal notranslate"><span class="pre">oldtype</span></code>. Legal values for type are <code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_DEFERRED</span></code>
and <code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_ASYNCHRONOUS</span></code>.</p>
<p>The cancellability state and type of any newly created threads are
<code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_ENABLE</span></code> and <code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_DEFERRED</span> <span class="pre">respectively</span></code>.</p>
<p><strong>Input Parameters:</strong></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>type</strong> – New cancellation state. One of <code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_DEFERRED</span></code>
or <code class="docutils literal notranslate"><span class="pre">PTHREAD_CANCEL_ASYNCHRONOUS</span></code>.</p></li>
<li><p><strong>oldtype</strong> – Location to return the previous cancellation type.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error.</p>
</dd>
</dl>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_testcancel">
<span class="pre">void</span> <code class="sig-name descname"><span class="pre">pthread_testcancel</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_testcancel" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_testcancel()</span></code> function creates a <a class="reference external" href="https://cwiki.apache.org/confluence/display/NUTTX/Cancellation+Points">Cancellation
Point</a>
in the calling thread. The <code class="docutils literal notranslate"><span class="pre">pthread_testcancel()</span></code> function has no
effect if cancellability is disabled.</p>
<p><strong>Input Parameters:</strong> None</p>
<p><strong>Returned Value:</strong> None</p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cleanup_pop">
<span class="pre">void</span> <code class="sig-name descname"><span class="pre">pthread_cleanup_pop</span></code><span class="sig-paren">(</span><span class="pre">int</span> <em><span class="pre">execute</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cleanup_pop" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_cleanup_pop()</span></code> function will remove the routine at the
top of the calling thread’s cancellation cleanup stack and optionally
invoke it (if <code class="docutils literal notranslate"><span class="pre">execute</span></code> is non-zero).</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">execute</span></code>. Execute the popped cleanup function immediately.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cleanup_push">
<span class="pre">void</span> <code class="sig-name descname"><span class="pre">pthread_cleanup_push</span></code><span class="sig-paren">(</span><span class="pre">CODE</span> <span class="pre">void</span> <span class="pre">(</span><span class="pre">*</span><em><span class="pre">routine</span></em><span class="pre">)</span><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">void</span><span class="pre">*</span><span class="sig-paren">)</span>, <span class="pre">FAR</span> <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em>, <span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cleanup_push" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_cleanup_push()</span></code> function will push the specified
cancellation cleanup handler routine onto the calling thread’s
cancellation cleanup stack.</p>
<p>The cancellation cleanup handler will be popped from the cancellation
cleanup stack and invoked with the argument arg when:</p>
<ul class="simple">
<li><p>The thread exits (that is, calls <code class="docutils literal notranslate"><span class="pre">pthread_exit()</span></code>).</p></li>
<li><p>The thread acts upon a cancellation request.</p></li>
<li><p>The thread calls <code class="docutils literal notranslate"><span class="pre">pthread_cleanup_pop()</span></code> with a non-zero execute
argument.</p></li>
</ul>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">routine</span></code>. The cleanup routine to be pushed on the cleanup stack.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">arg</span></code>. An argument that will accompany the callback.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_setcancelstate()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error.</p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_join">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_join</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em>, <span class="pre">pthread_addr_t</span> <span class="pre">*</span><em><span class="pre">ppvValue</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_join" title="Permalink to this definition"></a><br /></dt>
<dd><p>A thread can await termination of another thread and
retrieve the return value of the thread.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_join()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_yield">
<span class="pre">void</span> <code class="sig-name descname"><span class="pre">pthread_yield</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_yield" title="Permalink to this definition"></a><br /></dt>
<dd><p>A thread may tell the scheduler that its processor can
be made available.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p>None</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<ul class="simple">
<li><p>None. The <code class="docutils literal notranslate"><span class="pre">pthread_yield()</span></code> function always succeeds.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> This call is nonstandard, but present on
several other systems. Use the POSIX
<code class="docutils literal notranslate"><span class="pre">`sched_yield()</span></code> &lt;#sched_yield&gt;`__ instead.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_self">
<span class="pre">pthread_t</span> <code class="sig-name descname"><span class="pre">pthread_self</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_self" title="Permalink to this definition"></a><br /></dt>
<dd><p>A thread may obtain a copy of its own thread handle.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p>None</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_self()</span></code> function will return copy of
caller’s thread handle. Otherwise, in exceptional circumstances, the
negated error code <code class="docutils literal notranslate"><span class="pre">-ESRCH</span></code> can be returned if the system cannot
deduce the identity of the calling thread.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name. The <code class="docutils literal notranslate"><span class="pre">-ESRCH</span></code> return value is non-standard; POSIX says
<code class="docutils literal notranslate"><span class="pre">pthread_self()</span></code> must always succeed. NuttX implements
<code class="docutils literal notranslate"><span class="pre">pthread_self()</span></code> as a macro only, not as a function as required by
POSIX.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_getschedparam">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_getschedparam</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em>, <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">policy</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.sched_param" title="sched_param"><span class="pre">sched_param</span></a> <span class="pre">*</span><em><span class="pre">param</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_getschedparam" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_getschedparam()</span></code> functions will get the
scheduling policy and parameters of threads. For <code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> and
<code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code>, the only required member of the <code class="docutils literal notranslate"><span class="pre">sched_param</span></code> structure
is the priority <code class="docutils literal notranslate"><span class="pre">sched_priority</span></code>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">pthread_getschedparam()</span></code> function will retrieve the scheduling
policy and scheduling parameters for the thread whose thread ID is given
by <code class="docutils literal notranslate"><span class="pre">thread</span></code> and will store those values in <code class="docutils literal notranslate"><span class="pre">policy</span></code> and <code class="docutils literal notranslate"><span class="pre">param</span></code>,
respectively. The priority value returned from
<code class="docutils literal notranslate"><span class="pre">pthread_getschedparam()</span></code> will be the value specified by the most
recent <code class="docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code>, <code class="docutils literal notranslate"><span class="pre">pthread_setschedprio()</span></code>, or
<code class="docutils literal notranslate"><span class="pre">pthread_create()</span></code> call affecting the target thread. It will not
reflect any temporary adjustments to its priority (such as might result
of any priority inheritance, for example).</p>
<p>The policy parameter may have the value <code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code>, <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code>, or
<code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code>. <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code> requires the configuration setting
<code class="docutils literal notranslate"><span class="pre">CONFIG_RR_INTERVAL</span> <span class="pre">&gt;</span> <span class="pre">0</span></code>; <code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code> requires the
configuration setting <code class="docutils literal notranslate"><span class="pre">CONFIG_SCHED_SPORADIC=y</span></code>. (<code class="docutils literal notranslate"><span class="pre">SCHED_OTHER</span></code> and
non-standard scheduler policies, in particular, are not supported). The
<code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> and <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code> policies will have a single scheduling
parameter:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">sched_priority</span></code> The thread priority.</p></li>
</ul>
<p>The <code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code> policy has four additional scheduling parameters:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">sched_ss_low_priority</span></code> Low scheduling priority for sporadic
server.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sched_ss_repl_period</span></code> Replenishment period for sporadic server.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sched_ss_init_budget</span></code> Initial budget for sporadic server.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sched_ss_max_repl</span></code> Maximum pending replenishments for sporadic
server.</p></li>
</ul>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">thread</span></code>. The ID of thread whose scheduling parameters will be
queried.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">policy</span></code>. The location to store the thread’s scheduling policy.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">param</span></code>. The location to store the thread’s priority.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) if successful. Otherwise, the error code
<code class="docutils literal notranslate"><span class="pre">ESRCH</span></code> if the value specified by <code class="docutils literal notranslate"><span class="pre">thread</span></code> does not refer to an
existing thread.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_setschedparam">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_setschedparam</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em>, <span class="pre">int</span> <em><span class="pre">policy</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.sched_param" title="sched_param"><span class="pre">sched_param</span></a> <span class="pre">*</span><em><span class="pre">param</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_setschedparam" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code> functions will set the
scheduling policy and parameters of threads. For <code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> and
<code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code>, the only required member of the <code class="docutils literal notranslate"><span class="pre">sched_param</span></code> structure
is the priority <code class="docutils literal notranslate"><span class="pre">sched_priority</span></code>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code> function will set the scheduling policy
and associated scheduling parameters for the thread whose thread ID is
given by <code class="docutils literal notranslate"><span class="pre">thread</span></code> to the policy and associated parameters provided in
<code class="docutils literal notranslate"><span class="pre">policy</span></code> and <code class="docutils literal notranslate"><span class="pre">param</span></code>, respectively.</p>
<p>The policy parameter may have the value <code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> or <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code>.
(<code class="docutils literal notranslate"><span class="pre">SCHED_OTHER</span></code> and <code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code>, in particular, are not
supported). The <code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> and <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code> policies will have a
single scheduling parameter, <code class="docutils literal notranslate"><span class="pre">sched_priority</span></code>.</p>
<p>If the <code class="docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code> function fails, the scheduling
parameters will not be changed for the target thread.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">thread</span></code>. The ID of thread whose scheduling parameters will be
modified.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">policy</span></code>. The new scheduling policy of the thread. Either
<code class="docutils literal notranslate"><span class="pre">SCHED_FIFO</span></code> or <code class="docutils literal notranslate"><span class="pre">SCHED_RR</span></code>. <code class="docutils literal notranslate"><span class="pre">SCHED_OTHER</span></code> and
<code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code> are not supported.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">param</span></code>. The location to store the thread’s priority.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_setschedparam()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. The value specified by <code class="docutils literal notranslate"><span class="pre">policy</span></code> or one of the
scheduling parameters associated with the scheduling policy
<code class="docutils literal notranslate"><span class="pre">policy</span></code> is invalid.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ENOTSUP</span></code>. An attempt was made to set the policy or scheduling
parameters to an unsupported value (<code class="docutils literal notranslate"><span class="pre">SCHED_OTHER</span></code> and
<code class="docutils literal notranslate"><span class="pre">SCHED_SPORADIC</span></code> in particular are not supported)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EPERM</span></code>. The caller does not have the appropriate permission to set
either the scheduling parameters or the scheduling policy of the
specified thread. Or, the implementation does not allow the
application to modify one of the parameters to the value specified.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ESRCH</span></code>. The value specified by thread does not refer to a existing
thread.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_key_create">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_key_create</span></code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.pthread_key_t" title="pthread_key_t"><span class="pre">pthread_key_t</span></a> <span class="pre">*</span><em><span class="pre">key</span></em>, <span class="pre">void</span> <span class="pre">(</span><span class="pre">*</span><em><span class="pre">destructor</span></em><span class="pre">)</span><span class="sig-paren">(</span><span class="pre">void</span><span class="pre">*</span><span class="sig-paren">)</span><span class="sig-paren">)</span><a class="headerlink" href="#c.pthread_key_create" title="Permalink to this definition"></a><br /></dt>
<dd><p>This function creates a thread-specific data key visible to all threads
in the system. Although the same key value may be used by different
threads, the values bound to the key by <code class="docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code> are
maintained on a per-thread basis and persist for the life of the calling
thread.</p>
<p>Upon key creation, the value <code class="docutils literal notranslate"><span class="pre">NULL</span></code> will be associated with the new
key in all active threads. Upon thread creation, the value <code class="docutils literal notranslate"><span class="pre">NULL</span></code> will
be associated with all defined keys in the new thread.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">key</span></code> is a pointer to the key to create.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">destructor</span></code> is an optional destructor function that may be
associated with each key that is invoked when a thread exits.
However, this argument is ignored in the current implementation.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_key_create()</span></code> function will store the
newly created key value at <code class="docutils literal notranslate"><span class="pre">*key</span></code> and return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise,
an error number will be returned to indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EAGAIN</span></code>. The system lacked sufficient resources to create another
thread-specific data key, or the system-imposed limit on the total
number of keys per task {<code class="docutils literal notranslate"><span class="pre">PTHREAD_KEYS_MAX</span></code>} has been exceeded.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ENOMEM</span></code> Insufficient memory exists to create the key.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
<ul class="simple">
<li><p>The present implementation ignores the <code class="docutils literal notranslate"><span class="pre">destructor</span></code> argument.</p></li>
</ul>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_setspecific">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_setspecific</span></code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.pthread_key_t" title="pthread_key_t"><span class="pre">pthread_key_t</span></a> <em><span class="pre">key</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">value</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.pthread_setspecific" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code> function associates a thread-specific
value with a key obtained via a previous call to
<code class="docutils literal notranslate"><span class="pre">pthread_key_create()</span></code>. Different threads may bind different values to
the same key. These values are typically pointers to blocks of
dynamically allocated memory that have been reserved for use by the
calling thread.</p>
<p>The effect of calling <code class="docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code> with a key value not
obtained from <code class="docutils literal notranslate"><span class="pre">pthread_key_create()</span></code> or after a key has been deleted
with <code class="docutils literal notranslate"><span class="pre">pthread_key_delete()</span></code> is undefined.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">key</span></code>. The data key to set the binding for.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">value</span></code>. The value to bind to the key.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, <code class="docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code> will return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>).
Otherwise, an error number will be returned:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ENOMEM</span></code>. Insufficient memory exists to associate the value with
the key.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. The key value is invalid.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_setspecific()</span></code> may be called from a thread-specific data
destructor function.</p></li>
</ul>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_getspecific">
<span class="pre">void</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">pthread_getspecific</span></code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.pthread_key_t" title="pthread_key_t"><span class="pre">pthread_key_t</span></a> <em><span class="pre">key</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.pthread_getspecific" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_getspecific()</span></code> function returns the value currently bound
to the specified key on behalf of the calling thread.</p>
<p>The effect of calling <code class="docutils literal notranslate"><span class="pre">pthread_getspecific()</span></code> with a key value not
obtained from <code class="docutils literal notranslate"><span class="pre">pthread_key_create()</span></code> or after a key has been deleted
with <code class="docutils literal notranslate"><span class="pre">pthread_key_delete()</span></code> is undefined.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">key</span></code>. The data key to get the binding for.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>The function <code class="docutils literal notranslate"><span class="pre">pthread_getspecific()</span></code> returns the thread-specific data
associated with the given key. If no thread specific data is associated
with the key, then the value <code class="docutils literal notranslate"><span class="pre">NULL</span></code> is returned.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pthread_getspecific()</span></code> may be called from a thread-specific data
destructor function.</p></li>
</ul>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_key_delete">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_key_delete</span></code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.pthread_key_t" title="pthread_key_t"><span class="pre">pthread_key_t</span></a> <em><span class="pre">key</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.pthread_key_delete" title="Permalink to this definition"></a><br /></dt>
<dd><p>This POSIX function deletes a thread-specific data key previously
returned by <code class="docutils literal notranslate"><span class="pre">pthread_key_create()</span></code>. No cleanup actions are done for
data structures related to the deleted key or associated thread-specific
data in any threads. It is undefined behavior to use <code class="docutils literal notranslate"><span class="pre">key</span></code> after it
has been deleted.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">key</span></code>. The key to delete</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_key_delete()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. The parameter <code class="docutils literal notranslate"><span class="pre">key</span></code> is invalid.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_init</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_init" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_init()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_destroy</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_destroy()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_getpshared">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_getpshared</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">pshared</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_getpshared" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_getpshared()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_setpshared">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_setpshared</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">pshared</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_setpshared" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_setpshared()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_gettype">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_gettype</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">FAR</span> <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">type</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_gettype" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. The mutex attributes to query</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">type</span></code>. Location to return the mutex type. See
<code class="docutils literal notranslate"><span class="pre">`pthread_mutexattr_settype()</span></code> &lt;#pthreadmutexattrsettype&gt;`__ for a
description of possible mutex types that may be returned.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_settype()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. Parameters <code class="docutils literal notranslate"><span class="pre">attr</span></code> and/or <code class="docutils literal notranslate"><span class="pre">attr</span></code> are invalid.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_settype">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_settype</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">type</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_settype" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set the mutex type in the mutex attributes.</p>
<p><strong>Input Parameters:</strong></p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. The mutex attributes in which to set the mutex type.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">type</span></code>. The mutex type value to set. The following values are
supported:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_NORMAL</span></code>. This type of mutex does not detect
deadlock. A thread attempting to re-lock this mutex without first
unlocking it will deadlock. Attempting to unlock a mutex locked by
a different thread results in undefined behavior. Attempting to
unlock an unlocked mutex results in undefined behavior.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_ERRORCHECK</span></code>. This type of mutex provides error
checking. A thread attempting to re-lock this mutex without first
unlocking it will return with an error. A thread attempting to
unlock a mutex which another thread has locked will return with an
error. A thread attempting to unlock an unlocked mutex will return
with an error.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_RECURSIVE</span></code>. A thread attempting to re-lock this
mutex without first unlocking it will succeed in locking the
mutex. The re-locking deadlock which can occur with mutexes of
type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex.
Multiple locks of this mutex require the same number of unlocks to
release the mutex before another thread can acquire the mutex. A
thread attempting to unlock a mutex which another thread has
locked will return with an error. A thread attempting to unlock an
unlocked mutex will return with an error.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_DEFAULT</span></code>. The default mutex type
(PTHREAD_MUTEX_NORMAL).</p></li>
</ul>
<p>In NuttX, <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_NORMAL</span></code> is not implemented. Rather, the
behavior described for <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_ERRORCHECK</span></code> is the <em>normal</em>
behavior.</p>
</li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_settype()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. Parameters <code class="docutils literal notranslate"><span class="pre">attr</span></code> and/or <code class="docutils literal notranslate"><span class="pre">attr</span></code> are invalid.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_getprotocol">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_getprotocol</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">FAR</span> <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">protocol</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_getprotocol" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return the value of the mutex protocol attribute..</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. A pointer to the mutex attributes to be queried</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">protocol</span></code>. The user provided location in which to store the
protocol value. May be one of <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_NONE</span></code>, or
<code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_INHERIT</span></code>, <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_PROTECT</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_getprotocol()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutexattr_setprotocol">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutexattr_setprotocol</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">protocol</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutexattr_setprotocol" title="Permalink to this definition"></a><br /></dt>
<dd><p>Set mutex protocol attribute. See the paragraph
<a class="reference external" href="#lockingvssignaling">Locking versus Signaling Semaphores</a> for some
important information about the use of this interface.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. A pointer to the mutex attributes to be modified</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">protocol</span></code>. The new protocol to use. One of <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_NONE</span></code>,
or <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_INHERIT</span></code>, <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_PROTECT</span></code>.
<code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_INHERIT</span></code> is supported only if
<code class="docutils literal notranslate"><span class="pre">CONFIG_PRIORITY_INHERITANCE</span></code> is defined; <code class="docutils literal notranslate"><span class="pre">PTHREAD_PRIO_PROTECT</span></code>
is not currently supported in any configuration.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutexattr_setprotocol()</span></code> function will
return zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to
indicate the error.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_init</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em>, <span class="pre">pthread_mutexattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_init" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_init()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_destroy</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_destroy()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_lock">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_lock</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_lock" title="Permalink to this definition"></a><br /></dt>
<dd><p>The mutex object referenced by mutex is locked by
calling <code class="docutils literal notranslate"><span class="pre">pthread_mutex_lock()</span></code>. If the mutex is already locked, the
calling thread blocks until the mutex becomes available. This operation
returns with the mutex object referenced by mutex in the locked state
with the calling thread as its owner.</p>
<p>If the mutex type is <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_NORMAL</span></code>, deadlock detection is not
provided. Attempting to re-lock the mutex causes deadlock. If a thread
attempts to unlock a mutex that it has not locked or a mutex which is
unlocked, undefined behavior results.</p>
<p>In NuttX, <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_NORMAL</span></code> is not implemented. Rather, the
behavior described for <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_ERRORCHECK</span></code> is the <em>normal</em>
behavior.</p>
<p>If the mutex type is <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_ERRORCHECK</span></code>, then error checking
is provided. If a thread attempts to re-lock a mutex that it has already
locked, an error will be returned. If a thread attempts to unlock a
mutex that it has not locked or a mutex which is unlocked, an error will
be returned.</p>
<p>If the mutex type is <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_RECURSIVE</span></code>, then the mutex
maintains the concept of a lock count. When a thread successfully
acquires a mutex for the first time, the lock count is set to one. Every
time a thread re-locks this mutex, the lock count is incremented by one.
Each time the thread unlocks the mutex, the lock count is decremented by
one. When the lock count reaches zero, the mutex becomes available for
other threads to acquire. If a thread attempts to unlock a mutex that it
has not locked or a mutex which is unlocked, an error will be returned.</p>
<p>If a signal is delivered to a thread waiting for a mutex, upon return
from the signal handler the thread resumes waiting for the mutex as if
it was not interrupted.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mutex</span></code>. A reference to the mutex to be locked.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_lock()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p>Note that this function will never return the error EINTR.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_timedlock">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_timedlock</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.timespec" title="timespec"><span class="pre">timespec</span></a> <span class="pre">*</span><em><span class="pre">abs_timeout</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_timedlock" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_mutex_timedlock()</span></code> function will lock
the mutex object referenced by <code class="docutils literal notranslate"><span class="pre">mutex</span></code>. If the mutex is already
locked, the calling thread will block until the mutex becomes available
as in the <code class="docutils literal notranslate"><span class="pre">`pthread_mutex_lock()</span></code> &lt;#pthreadmutexlock&gt;`__ function. If
the mutex cannot be locked without waiting for another thread to unlock
the mutex, this wait will be terminated when the specified
<code class="docutils literal notranslate"><span class="pre">abs_timeout</span></code> expires.</p>
<p>The timeout will expire when the absolute time specified by
<code class="docutils literal notranslate"><span class="pre">abs_timeout</span></code> passes, as measured by the clock on which timeouts are
based (that is, when the value of that clock equals or exceeds
<code class="docutils literal notranslate"><span class="pre">abs_timeout</span></code>), or if the absolute time specified by <code class="docutils literal notranslate"><span class="pre">abs_timeout</span></code>
has already been passed at the time of the call.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mutex</span></code>. A reference to the mutex to be locked.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">abs_timeout</span></code>. Maximum wait time (with <code class="docutils literal notranslate"><span class="pre">NULL</span></code> meaning to wait
forever).</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_trylock()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error. Note that the errno <code class="docutils literal notranslate"><span class="pre">EINTR</span></code> is never returned by
<code class="docutils literal notranslate"><span class="pre">pthread_mutex_timedlock()</span></code>. The returned errno is ETIMEDOUT if the
mutex could not be locked before the specified timeout expired</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name. This implementation does not return <code class="docutils literal notranslate"><span class="pre">EAGAIN</span></code> when the mutex
could not be acquired because the maximum number of recursive locks for
mutex has been exceeded.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_trylock">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_trylock</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_trylock" title="Permalink to this definition"></a><br /></dt>
<dd><p>The function <code class="docutils literal notranslate"><span class="pre">pthread_mutex_trylock()</span></code> is identical
to <code class="docutils literal notranslate"><span class="pre">`pthread_mutex_lock()</span></code> &lt;#pthreadmutexlock&gt;`__ except that if the
mutex object referenced by mutex is currently locked (by any thread,
including the current thread), the call returns immediately with the
<code class="docutils literal notranslate"><span class="pre">errno</span></code> <code class="docutils literal notranslate"><span class="pre">EBUSY</span></code>.</p>
<p>If a signal is delivered to a thread waiting for a mutex, upon return
from the signal handler the thread resumes waiting for the mutex as if
it was not interrupted.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mutex</span></code>. A reference to the mutex to be locked.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_trylock()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p>Note that this function will never return the error EINTR.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_mutex_unlock">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_mutex_unlock</span></code><span class="sig-paren">(</span><span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_mutex_unlock" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_mutex_unlock()</span></code> function releases the mutex object
referenced by mutex. The manner in which a mutex is released is
dependent upon the mutex’s type attribute. If there are threads blocked
on the mutex object referenced by mutex when <code class="docutils literal notranslate"><span class="pre">pthread_mutex_unlock()</span></code>
is called, resulting in the mutex becoming available, the scheduling
policy is used to determine which thread will acquire the mutex. (In the
case of <code class="docutils literal notranslate"><span class="pre">PTHREAD_MUTEX_RECURSIVE</span></code> mutexes, the mutex becomes available
when the count reaches zero and the calling thread no longer has any
locks on this mutex).</p>
<p>If a signal is delivered to a thread waiting for a mutex, upon return
from the signal handler the thread resumes waiting for the mutex as if
it was not interrupted.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mutex</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_mutex_unlock()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p>Note that this function will never return the error EINTR.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_condattr_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_condattr_init</span></code><span class="sig-paren">(</span><span class="pre">pthread_condattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_condattr_init" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_condattr_init()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_condattr_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_condattr_destroy</span></code><span class="sig-paren">(</span><span class="pre">pthread_condattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_condattr_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_condattr_destroy()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_init</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">cond</span></em>, <span class="pre">pthread_condattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_init" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_init()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_destroy</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">cond</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_destroy()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_broadcast">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_broadcast</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">cond</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_broadcast" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_broadcast()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_signal">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_signal</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">dond</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_signal" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_signal()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_wait">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_wait</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">cond</span></em>, <span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_wait" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_wait()</span></code> function will return zero
(<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate the
error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_cond_timedwait">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_cond_timedwait</span></code><span class="sig-paren">(</span><span class="pre">pthread_cond_t</span> <span class="pre">*</span><em><span class="pre">cond</span></em>, <span class="pre">pthread_mutex_t</span> <span class="pre">*</span><em><span class="pre">mutex</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="structures.html#c.timespec" title="timespec"><span class="pre">timespec</span></a> <span class="pre">*</span><em><span class="pre">abstime</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_cond_timedwait" title="Permalink to this definition"></a><br /></dt>
<dd><p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>If successful, the <code class="docutils literal notranslate"><span class="pre">pthread_cond_timedwait()</span></code> function will return
zero (<code class="docutils literal notranslate"><span class="pre">OK</span></code>). Otherwise, an error number will be returned to indicate
the error:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">To</span> <span class="pre">be</span> <span class="pre">provided</span></code>.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrierattr_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrierattr_init</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrierattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrierattr_init" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrierattr_init()</span></code> function will
initialize a barrier attribute object <code class="docutils literal notranslate"><span class="pre">attr</span></code> with the default value
for all of the attributes defined by the implementation.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. Barrier attributes to be initialized.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if <code class="docutils literal notranslate"><span class="pre">attr</span></code> is
invalid.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrierattr_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrierattr_destroy</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrierattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrierattr_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrierattr_destroy()</span></code> function will
destroy a barrier attributes object. A destroyed attributes object can
be reinitialized using <code class="docutils literal notranslate"><span class="pre">pthread_barrierattr_init()</span></code>; the results of
otherwise referencing the object after it has been destroyed are
undefined.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. Barrier attributes to be destroyed.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if attr is
invalid.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrierattr_setpshared">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrierattr_setpshared</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrierattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">int</span> <em><span class="pre">pshared</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrierattr_setpshared" title="Permalink to this definition"></a><br /></dt>
<dd><p>The process-shared attribute is set to
<code class="docutils literal notranslate"><span class="pre">PTHREAD_PROCESS_SHARED</span></code> to permit a barrier to be operated upon by
any thread that has access to the memory where the barrier is allocated.
If the process-shared attribute is <code class="docutils literal notranslate"><span class="pre">PTHREAD_PROCESS_PRIVATE</span></code>, the
barrier can only be operated upon by threads created within the same
process as the thread that initialized the barrier. If threads of
different processes attempt to operate on such a barrier, the behavior
is undefined. The default value of the attribute is
<code class="docutils literal notranslate"><span class="pre">PTHREAD_PROCESS_PRIVATE</span></code>.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. Barrier attributes to be modified.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pshared</span></code>. The new value of the pshared attribute.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if either
<code class="docutils literal notranslate"><span class="pre">attr</span></code> is invalid or <code class="docutils literal notranslate"><span class="pre">pshared</span></code> is not one of
<code class="docutils literal notranslate"><span class="pre">PTHREAD_PROCESS_SHARED</span></code> or <code class="docutils literal notranslate"><span class="pre">PTHREAD_PROCESS_PRIVATE</span></code>.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrierattr_getpshared">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrierattr_getpshared</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_barrierattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">FAR</span> <span class="pre">int</span> <span class="pre">*</span><em><span class="pre">pshared</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrierattr_getpshared" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrierattr_getpshared()</span></code> function will
obtain the value of the process-shared attribute from the attributes
object referenced by <code class="docutils literal notranslate"><span class="pre">attr</span></code>.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. Barrier attributes to be queried.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pshared</span></code>. The location to stored the current value of the pshared
attribute.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if either
<code class="docutils literal notranslate"><span class="pre">attr</span></code> or <code class="docutils literal notranslate"><span class="pre">pshared</span></code> is invalid.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrier_init">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrier_init</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrier_t</span> <span class="pre">*</span><em><span class="pre">barrier</span></em>, <span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <span class="pre">pthread_barrierattr_t</span> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">unsigned</span> <span class="pre">int</span> <em><span class="pre">count</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrier_init" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code> function allocates any
resources required to use the barrier referenced by <code class="docutils literal notranslate"><span class="pre">barrier</span></code> and
initialized the barrier with the attributes referenced by <code class="docutils literal notranslate"><span class="pre">attr</span></code>. If
<code class="docutils literal notranslate"><span class="pre">attr</span></code> is NULL, the default barrier attributes will be used. The
results are undefined if <code class="docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code> is called when any
thread is blocked on the barrier. The results are undefined if a barrier
is used without first being initialized. The results are undefined if
<code class="docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code> is called specifying an already initialized
barrier.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">barrier</span></code>. The barrier to be initialized.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr</span></code>. Barrier attributes to be used in the initialization.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">count</span></code>. The count to be associated with the barrier. The count
argument specifies the number of threads that must call
<code class="docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code> before any of them successfully return
from the call. The value specified by count must be greater than
zero.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or one of the following error
numbers:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EAGAIN</span></code>. The system lacks the necessary resources to initialize
another barrier.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. The <code class="docutils literal notranslate"><span class="pre">barrier</span></code> reference is invalid, or the values
specified by <code class="docutils literal notranslate"><span class="pre">attr</span></code> are invalid, or the value specified by
<code class="docutils literal notranslate"><span class="pre">count</span></code> is equal to zero.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ENOMEM</span></code>. Insufficient memory exists to initialize the barrier.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EBUSY</span></code>. The implementation has detected an attempt to reinitialize
a barrier while it is in use.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrier_destroy">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrier_destroy</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrier_t</span> <span class="pre">*</span><em><span class="pre">barrier</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrier_destroy" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrier_destroy()</span></code> function destroys the
barrier referenced by <code class="docutils literal notranslate"><span class="pre">barrie</span></code> and releases any resources used by the
barrier. The effect of subsequent use of the barrier is undefined until
the barrier is reinitialized by another call to
<code class="docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code>. The results are undefined if
<code class="docutils literal notranslate"><span class="pre">pthread_barrier_destroy()</span></code> is called when any thread is blocked on
the barrier, or if this function is called with an uninitialized
barrier.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">barrier</span></code>. The barrier to be destroyed.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or one of the following error
numbers:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EBUSY</span></code>. The implementation has detected an attempt to destroy a
barrier while it is in use.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. The value specified by <code class="docutils literal notranslate"><span class="pre">barrier</span></code> is invalid.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_barrier_wait">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_barrier_wait</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_barrier_t</span> <span class="pre">*</span><em><span class="pre">barrier</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_barrier_wait" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code> function synchronizes
participating threads at the barrier referenced by <code class="docutils literal notranslate"><span class="pre">barrier</span></code>. The
calling thread is blocked until the required number of threads have
called <code class="docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code> specifying the same <code class="docutils literal notranslate"><span class="pre">barrier</span></code>. When
the required number of threads have called <code class="docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code>
specifying the <code class="docutils literal notranslate"><span class="pre">barrier</span></code>, the constant
<code class="docutils literal notranslate"><span class="pre">PTHREAD_BARRIER_SERIAL_THREAD</span></code> will be returned to one unspecified
thread and zero will be returned to each of the remaining threads. At
this point, the barrier will be reset to the state it had as a result of
the most recent <code class="docutils literal notranslate"><span class="pre">pthread_barrier_init()</span></code> function that referenced it.</p>
<p>The constant <code class="docutils literal notranslate"><span class="pre">PTHREAD_BARRIER_SERIAL_THREAD</span></code> is defined in
<code class="docutils literal notranslate"><span class="pre">pthread.h</span></code> and its value must be distinct from any other value
returned by <code class="docutils literal notranslate"><span class="pre">pthread_barrier_wait()</span></code>.</p>
<p>The results are undefined if this function is called with an
uninitialized barrier.</p>
<p>If a signal is delivered to a thread blocked on a barrier, upon return
from the signal handler the thread will resume waiting at the barrier if
the barrier wait has not completed. Otherwise, the thread will continue
as normal from the completed barrier wait. Until the thread in the
signal handler returns from it, it is unspecified whether other threads
may proceed past the barrier once they have all reached it.</p>
<p>A thread that has blocked on a barrier will not prevent any unblocked
thread that is eligible to use the same processing resources from
eventually making forward progress in its execution. Eligibility for
processing resources will be determined by the scheduling policy.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">barrier</span></code>. The barrier on which to wait.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if the barrier
is not valid.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_once">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_once</span></code><span class="sig-paren">(</span><span class="pre">FAR</span> <span class="pre">pthread_once_t</span> <span class="pre">*</span><em><span class="pre">once_control</span></em>, <span class="pre">CODE</span> <span class="pre">void</span> <span class="pre">(</span><span class="pre">*</span><em><span class="pre">init_routine</span></em><span class="pre">)</span><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_once" title="Permalink to this definition"></a><br /></dt>
<dd><p>The first call to <code class="docutils literal notranslate"><span class="pre">pthread_once()</span></code> by any thread with
a given <code class="docutils literal notranslate"><span class="pre">once_control</span></code>, will call the <code class="docutils literal notranslate"><span class="pre">init_routine()</span></code> with no
arguments. Subsequent calls to <code class="docutils literal notranslate"><span class="pre">pthread_once()</span></code> with the same
<code class="docutils literal notranslate"><span class="pre">once_control</span></code> will have no effect. On return from <code class="docutils literal notranslate"><span class="pre">pthread_once()</span></code>,
<code class="docutils literal notranslate"><span class="pre">init_routine()</span></code> will have completed.</p>
<p><strong>Input Parameters:</strong></p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">once_control</span></code>. Determines if <code class="docutils literal notranslate"><span class="pre">init_routine()</span></code> should be called.
<code class="docutils literal notranslate"><span class="pre">once_control</span></code> should be declared and initialized as follows:</p>
<p><code class="docutils literal notranslate"><span class="pre">PTHREAD_ONCE_INIT</span></code> is defined in <code class="docutils literal notranslate"><span class="pre">pthread.h</span></code>.</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">init_routine</span></code>. The initialization routine that will be called
once.</p></li>
</ul>
<p><strong>Returned Value:</strong> 0 (<code class="docutils literal notranslate"><span class="pre">OK</span></code>) on success or <code class="docutils literal notranslate"><span class="pre">EINVAL</span></code> if either
once_control or init_routine are invalid.</p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_kill">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_kill</span></code><span class="sig-paren">(</span><span class="pre">pthread_t</span> <em><span class="pre">thread</span></em>, <span class="pre">int</span> <em><span class="pre">signo</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.pthread_kill" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">pthread_kill()</span></code> system call can be used to send
any signal to a thread. See <code class="docutils literal notranslate"><span class="pre">kill()</span></code> for further information as this
is just a simple wrapper around the <code class="docutils literal notranslate"><span class="pre">kill()</span></code> function.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">thread</span></code>. The id of the thread to receive the signal. Only
positive, non-zero values of <code class="docutils literal notranslate"><span class="pre">tthread</span></code>t are supported.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">signo</span></code>. The signal number to send. If <code class="docutils literal notranslate"><span class="pre">signo</span></code> is zero, no signal
is sent, but all error checking is performed.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p>On success, the signal was sent and zero is returned. On error one of
the following error numbers is returned.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">EINVAL</span></code>. An invalid signal was specified.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">EPERM</span></code>. The thread does not have permission to send the signal to
the target thread.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ESRCH</span></code>. No thread could be found corresponding to that specified
by the given thread ID.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ENOSYS</span></code>. Do not support sending signals to process groups.</p></li>
</ul>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
<dl class="c function">
<dt id="c.pthread_sigmask">
<span class="pre">int</span> <code class="sig-name descname"><span class="pre">pthread_sigmask</span></code><span class="sig-paren">(</span><span class="pre">int</span> <em><span class="pre">how</span></em>, <span class="pre">FAR</span> <em class="property"><span class="pre">const</span></em> <a class="reference internal" href="structures.html#c.sigset_t" title="sigset_t"><span class="pre">sigset_t</span></a> <span class="pre">*</span><em><span class="pre">set</span></em>, <span class="pre">FAR</span> <a class="reference internal" href="structures.html#c.sigset_t" title="sigset_t"><span class="pre">sigset_t</span></a> <span class="pre">*</span><em><span class="pre">oset</span></em><span class="sig-paren">)</span><span class="pre">;</span><a class="headerlink" href="#c.pthread_sigmask" title="Permalink to this definition"></a><br /></dt>
<dd><p>This function is a simple wrapper around
<code class="docutils literal notranslate"><span class="pre">sigprocmask()</span></code>. See the <code class="docutils literal notranslate"><span class="pre">sigprocmask()</span></code> function description for
further information.</p>
<p><strong>Input Parameters:</strong></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">how</span></code>. How the signal mask will be changed:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">SIG_BLOCK</span></code>: The resulting set is the union of the current set
and the signal set pointed to by <code class="docutils literal notranslate"><span class="pre">set</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SIG_UNBLOCK</span></code>: The resulting set is the intersection of the
current set and the complement of the signal set pointed to by
<code class="docutils literal notranslate"><span class="pre">set</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SIG_SETMASK</span></code>: The resulting set is the signal set pointed to by
<code class="docutils literal notranslate"><span class="pre">set</span></code>.</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">set</span></code>. Location of the new signal mask.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">oset</span></code>. Location to store the old signal mask.</p></li>
</ul>
<p><strong>Returned Value:</strong></p>
<p><strong>Assumptions/Limitations:</strong></p>
<p><strong>POSIX Compatibility:</strong> Comparable to the POSIX interface of the same
name.</p>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="09_env_vars.html" class="btn btn-neutral float-right" title="Environment Variables" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="07_signals.html" class="btn btn-neutral float-left" title="Signal Interfaces" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2020, The Apache Software Foundation.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>