pthreads: Fix pthread_mutexattr_init(). It was not initializing the protocol field when priority inheritance is enabled.

This commit is contained in:
Gregory Nutt 2017-03-10 09:24:41 -06:00
parent a93e46d00c
commit 769427ed5a
2 changed files with 4 additions and 3 deletions

View File

@ -81,5 +81,3 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr)
linfo("Returning %d\n", ret);
return ret;
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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
{
attr->pshared = 0;
#ifdef CONFIG_PRIORITY_INHERITANCE
attr->proto = SEM_PRIO_INHERIT;
#endif
#ifdef CONFIG_MUTEX_TYPES
attr->type = PTHREAD_MUTEX_DEFAULT;
#endif