[FE training-materials-updates] sysdev-realtime: pthread_mutexattr_getprotocol() should have been pthread_mutexarttr_setprotocol()

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Nov 27 09:31:08 CET 2012


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=e0b63482181b305c6eff9731fa4328f7d4027805

>---------------------------------------------------------------

commit e0b63482181b305c6eff9731fa4328f7d4027805
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Tue Nov 27 09:29:52 2012 +0100

    sysdev-realtime: pthread_mutexattr_getprotocol() should have been pthread_mutexarttr_setprotocol()
    
    In our description on how to enable priority inheritance on pthread
    mutexes, the sample code was using pthread_mutexattr_getprotocol(),
    while it should obviously be pthread_mutexattr_setprotocol().
    
    Thanks a lot to Alison Chaiken for reporting the problem!
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


>---------------------------------------------------------------

e0b63482181b305c6eff9731fa4328f7d4027805
 slides/sysdev-realtime/sysdev-realtime.tex |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slides/sysdev-realtime/sysdev-realtime.tex b/slides/sysdev-realtime/sysdev-realtime.tex
index bac3307..dc2b67a 100644
--- a/slides/sysdev-realtime/sysdev-realtime.tex
+++ b/slides/sysdev-realtime/sysdev-realtime.tex
@@ -738,7 +738,7 @@ pthread_mutex_unlock(pthread_mutex_t *mutex);
 \begin{verbatim}
 pthread_mutexattr_t attr;
 pthread_mutexattr_init (&attr);
-pthread_mutexattr_getprotocol(&attr, PTHREAD_PRIO_INHERIT);
+pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
 \end{verbatim}
 \normalsize
     \end{block}



More information about the training-materials-updates mailing list