OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [posix-synchronization.html] - Diff between revs 28 and 174

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
>Synchronization [POSIX Section 11]</TITLE
>Synchronization [POSIX Section 11]</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="eCos Reference Manual"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
HREF="ecos-ref.html"><LINK
REL="UP"
REL="UP"
TITLE="POSIX Standard Support"
TITLE="POSIX Standard Support"
HREF="posix-standard-support.html"><LINK
HREF="posix-standard-support.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="Data Interchange Format [POSIX Section 10]"
TITLE="Data Interchange Format [POSIX Section 10]"
HREF="posix-data-interchange-format.html"><LINK
HREF="posix-data-interchange-format.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="Memory Management [POSIX Section 12]"
TITLE="Memory Management [POSIX Section 12]"
HREF="posix-memory-management.html"></HEAD
HREF="posix-memory-management.html"></HEAD
><BODY
><BODY
CLASS="SECT1"
CLASS="SECT1"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>eCos Reference Manual</TH
>eCos Reference Manual</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="posix-data-interchange-format.html"
HREF="posix-data-interchange-format.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
>Chapter 31. POSIX Standard Support</TD
>Chapter 31. POSIX Standard Support</TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="posix-memory-management.html"
HREF="posix-memory-management.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><DIV
><DIV
CLASS="SECT1"
CLASS="SECT1"
><H1
><H1
CLASS="SECT1"
CLASS="SECT1"
><A
><A
NAME="POSIX-SYNCHRONIZATION">Synchronization &#0091;POSIX Section 11&#0093;</H1
NAME="POSIX-SYNCHRONIZATION">Synchronization &#0091;POSIX Section 11&#0093;</H1
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="AEN13150">Functions Implemented</H2
NAME="AEN13150">Functions Implemented</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="SCREEN"
CLASS="SCREEN"
>int sem&#0095;init(sem&#0095;t &#0042;sem, int pshared, unsigned int value);
>int sem&#0095;init(sem&#0095;t &#0042;sem, int pshared, unsigned int value);
int sem&#0095;destroy(sem&#0095;t &#0042;sem);
int sem&#0095;destroy(sem&#0095;t &#0042;sem);
int sem&#0095;wait(sem&#0095;t &#0042;sem);
int sem&#0095;wait(sem&#0095;t &#0042;sem);
int sem&#0095;trywait(sem&#0095;t &#0042;sem);
int sem&#0095;trywait(sem&#0095;t &#0042;sem);
int sem&#0095;post(sem&#0095;t &#0042;sem);
int sem&#0095;post(sem&#0095;t &#0042;sem);
int sem&#0095;getvalue(sem&#0095;t &#0042;sem, int &#0042;sval);
int sem&#0095;getvalue(sem&#0095;t &#0042;sem, int &#0042;sval);
int pthread&#0095;mutexattr&#0095;init( pthread&#0095;mutexattr&#0095;t &#0042;attr);
int pthread&#0095;mutexattr&#0095;init( pthread&#0095;mutexattr&#0095;t &#0042;attr);
int pthread&#0095;mutexattr&#0095;destroy( pthread&#0095;mutexattr&#0095;t &#0042;attr);
int pthread&#0095;mutexattr&#0095;destroy( pthread&#0095;mutexattr&#0095;t &#0042;attr);
int pthread&#0095;mutex&#0095;init(pthread&#0095;mutex&#0095;t &#0042;mutex,
int pthread&#0095;mutex&#0095;init(pthread&#0095;mutex&#0095;t &#0042;mutex,
                       const pthread&#0095;mutexattr&#0095;t &#0042;mutex&#0095;attr);
                       const pthread&#0095;mutexattr&#0095;t &#0042;mutex&#0095;attr);
int pthread&#0095;mutex&#0095;destroy(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;destroy(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;lock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;lock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;trylock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;trylock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;unlock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;mutex&#0095;unlock(pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;condattr&#0095;init(pthread&#0095;condattr&#0095;t &#0042;attr);
int pthread&#0095;condattr&#0095;init(pthread&#0095;condattr&#0095;t &#0042;attr);
int pthread&#0095;condattr&#0095;destroy(pthread&#0095;condattr&#0095;t &#0042;attr);
int pthread&#0095;condattr&#0095;destroy(pthread&#0095;condattr&#0095;t &#0042;attr);
int pthread&#0095;cond&#0095;init(pthread&#0095;cond&#0095;t &#0042;cond,
int pthread&#0095;cond&#0095;init(pthread&#0095;cond&#0095;t &#0042;cond,
                       const pthread&#0095;condattr&#0095;t &#0042;attr);
                       const pthread&#0095;condattr&#0095;t &#0042;attr);
int pthread&#0095;cond&#0095;destroy(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;destroy(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;signal(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;signal(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;broadcast(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;broadcast(pthread&#0095;cond&#0095;t &#0042;cond);
int pthread&#0095;cond&#0095;wait(pthread&#0095;cond&#0095;t &#0042;cond,
int pthread&#0095;cond&#0095;wait(pthread&#0095;cond&#0095;t &#0042;cond,
                       pthread&#0095;mutex&#0095;t &#0042;mutex);
                       pthread&#0095;mutex&#0095;t &#0042;mutex);
int pthread&#0095;cond&#0095;timedwait(pthread&#0095;cond&#0095;t &#0042;cond,
int pthread&#0095;cond&#0095;timedwait(pthread&#0095;cond&#0095;t &#0042;cond,
                           pthread&#0095;mutex&#0095;t &#0042;mutex,
                           pthread&#0095;mutex&#0095;t &#0042;mutex,
                           const struct timespec &#0042;abstime);</PRE
                           const struct timespec &#0042;abstime);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="AEN13153">Functions Omitted</H2
NAME="AEN13153">Functions Omitted</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="SCREEN"
CLASS="SCREEN"
>sem&#0095;t &#0042;sem&#0095;open(const char &#0042;name, int oflag, ...);             &#0047;&#0047; TBA
>sem&#0095;t &#0042;sem&#0095;open(const char &#0042;name, int oflag, ...);             &#0047;&#0047; TBA
int sem&#0095;close(sem&#0095;t &#0042;sem);                                    &#0047;&#0047; TBA
int sem&#0095;close(sem&#0095;t &#0042;sem);                                    &#0047;&#0047; TBA
int sem&#0095;unlink(const char &#0042;name);                           &#0047;&#0047; TBA
int sem&#0095;unlink(const char &#0042;name);                           &#0047;&#0047; TBA
int pthread&#0095;mutexattr&#0095;getpshared( const pthread&#0095;mutexattr&#0095;t &#0042;attr,
int pthread&#0095;mutexattr&#0095;getpshared( const pthread&#0095;mutexattr&#0095;t &#0042;attr,
                                  int &#0042;pshared );
                                  int &#0042;pshared );
int pthread&#0095;mutexattr&#0095;setpshared( const pthread&#0095;mutexattr&#0095;t &#0042;attr,
int pthread&#0095;mutexattr&#0095;setpshared( const pthread&#0095;mutexattr&#0095;t &#0042;attr,
                                  int pshared );
                                  int pshared );
int  pthread&#0095;condattr&#0095;getpshared( const pthread&#0095;condattr&#0095;t &#0042;attr,
int  pthread&#0095;condattr&#0095;getpshared( const pthread&#0095;condattr&#0095;t &#0042;attr,
                                  int &#0042;pshared);
                                  int &#0042;pshared);
int  pthread&#0095;condattr&#0095;setpshared( const pthread&#0095;condattr&#0095;t &#0042;attr,
int  pthread&#0095;condattr&#0095;setpshared( const pthread&#0095;condattr&#0095;t &#0042;attr,
                                  int pshared);</PRE
                                  int pshared);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="AEN13156">Notes</H2
NAME="AEN13156">Notes</H2
><P
><P
></P
></P
><UL
><UL
><LI
><LI
><P
><P
>           The presence of semaphores is controlled by the
>           The presence of semaphores is controlled by the
            CYGPKG&#0095;POSIX&#0095;SEMAPHORES option. This in turn
            CYGPKG&#0095;POSIX&#0095;SEMAPHORES option. This in turn
            causes the &#0095;POSIX&#0095;SEMAPHORES feature test
            causes the &#0095;POSIX&#0095;SEMAPHORES feature test
            macro to be defined and the semaphore API to be made
            macro to be defined and the semaphore API to be made
            available.
            available.
            </P
            </P
></LI
></LI
><LI
><LI
><P
><P
>           The <SPAN
>           The <SPAN
CLASS="strong"
CLASS="strong"
><B
><B
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pshared</B
>pshared</B
></SPAN
></SPAN
> argument to
> argument to
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>sem&#0095;init()</I
>sem&#0095;init()</I
></SPAN
></SPAN
> is not implemented,
> is not implemented,
            its value is ignored.
            its value is ignored.
            </P
            </P
></LI
></LI
><LI
><LI
><P
><P
>           Functions <SPAN
>           Functions <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>sem&#0095;open()</I
>sem&#0095;open()</I
></SPAN
></SPAN
>,
>,
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>sem&#0095;close()</I
>sem&#0095;close()</I
></SPAN
></SPAN
> and
> and
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>sem&#0095;unlink()</I
>sem&#0095;unlink()</I
></SPAN
></SPAN
> are present but
> are present but
            always return an error (ENOSYS).
            always return an error (ENOSYS).
            </P
            </P
></LI
></LI
><LI
><LI
><P
><P
>           The exact priority inversion protocols supported may be
>           The exact priority inversion protocols supported may be
            controlled with the
            controlled with the
            &#0095;POSIX&#0095;THREAD&#0095;PRIO&#0095;INHERIT and
            &#0095;POSIX&#0095;THREAD&#0095;PRIO&#0095;INHERIT and
            &#0095;POSIX&#0095;THREAD&#0095;PRIO&#0095;PROTECT
            &#0095;POSIX&#0095;THREAD&#0095;PRIO&#0095;PROTECT
            configuration options.
            configuration options.
            </P
            </P
></LI
></LI
><LI
><LI
><P
><P
>           &#0123;&#0095;POSIX&#0095;THREAD&#0095;PROCESS&#0095;SHARED&#0125; is
>           &#0123;&#0095;POSIX&#0095;THREAD&#0095;PROCESS&#0095;SHARED&#0125; is
            not defined, so the
            not defined, so the
            <SPAN
            <SPAN
CLASS="strong"
CLASS="strong"
><B
><B
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>process-shared</B
>process-shared</B
></SPAN
></SPAN
> mutex
> mutex
            and condition variable attributes are not supported, and
            and condition variable attributes are not supported, and
            neither are the functions
            neither are the functions
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pthread&#0095;mutexattr&#0095;getpshared()</I
>pthread&#0095;mutexattr&#0095;getpshared()</I
></SPAN
></SPAN
>,
>,
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pthread&#0095;mutexattr&#0095;setpshared()</I
>pthread&#0095;mutexattr&#0095;setpshared()</I
></SPAN
></SPAN
>,
>,
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pthread&#0095;condattr&#0095;getpshared()</I
>pthread&#0095;condattr&#0095;getpshared()</I
></SPAN
></SPAN
> and
> and
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pthread&#0095;condattr&#0095;setpshared()</I
>pthread&#0095;condattr&#0095;setpshared()</I
></SPAN
></SPAN
>.
>.
            </P
            </P
></LI
></LI
><LI
><LI
><P
><P
>           Condition variables do not become bound to a particular
>           Condition variables do not become bound to a particular
            mutex when
            mutex when
            <SPAN
            <SPAN
CLASS="emphasis"
CLASS="emphasis"
><I
><I
CLASS="EMPHASIS"
CLASS="EMPHASIS"
>pthread&#0095;cond&#0095;wait()</I
>pthread&#0095;cond&#0095;wait()</I
></SPAN
></SPAN
> is
> is
            called. Hence different threads may wait on a condition
            called. Hence different threads may wait on a condition
            variable with different mutexes. This is at variance with
            variable with different mutexes. This is at variance with
            the standard, which requires a condition variable to
            the standard, which requires a condition variable to
            become (dynamically) bound by the first waiter, and
            become (dynamically) bound by the first waiter, and
            unbound when the last finishes. However, this difference
            unbound when the last finishes. However, this difference
            is largely benign, and the cost of policing this feature
            is largely benign, and the cost of policing this feature
            is non-trivial.
            is non-trivial.
          </P
          </P
></LI
></LI
></UL
></UL
></DIV
></DIV
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="posix-data-interchange-format.html"
HREF="posix-data-interchange-format.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ecos-ref.html"
HREF="ecos-ref.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="posix-memory-management.html"
HREF="posix-memory-management.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
>Data Interchange Format &#0091;POSIX Section 10&#0093;</TD
>Data Interchange Format &#0091;POSIX Section 10&#0093;</TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="posix-standard-support.html"
HREF="posix-standard-support.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
>Memory Management &#0091;POSIX Section 12&#0093;</TD
>Memory Management &#0091;POSIX Section 12&#0093;</TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.