pthreads: Add more robustness characteristics: pthread_mutex_lock() and trylock() will now return EOWNERDEAD if the mutex is locked by a thread that no longer exists. Add pthread_mutex_consistent() to recover from this situation.

This commit is contained in:
Gregory Nutt
2017-03-26 10:35:23 -06:00
parent bacc4e9b93
commit 363403fb1f
8 changed files with 343 additions and 92 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
/********************************************************************************
* include/pthread.h
*
* Copyright (C) 2007-2009, 2011-2012, 2015-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2011-2012, 2015-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -424,6 +424,10 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
int pthread_mutex_unlock(FAR pthread_mutex_t *mutex);
/* Make sure that the pthread mutex is in a consistent state */
int pthread_mutex_consistent(FAR pthread_mutex_t *mutex);
/* Operations on condition variables */
int pthread_condattr_init(FAR pthread_condattr_t *attr);