mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
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:
+5
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user