pthreads: Fix pthread_mutexattr_init(). It was not initializing the protocol field when priority inheritance is enabled.
This commit is contained in:
parent
a93e46d00c
commit
769427ed5a
@ -81,5 +81,3 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr)
|
|||||||
linfo("Returning %d\n", ret);
|
linfo("Returning %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* libc/pthread/pthread_mutexattr_init.c
|
* libc/pthread/pthread_mutexattr_init.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -76,6 +76,9 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
attr->pshared = 0;
|
attr->pshared = 0;
|
||||||
|
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||||
|
attr->proto = SEM_PRIO_INHERIT;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_MUTEX_TYPES
|
#ifdef CONFIG_MUTEX_TYPES
|
||||||
attr->type = PTHREAD_MUTEX_DEFAULT;
|
attr->type = PTHREAD_MUTEX_DEFAULT;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user