Fixed recursive release for mutexes with nesting allowed.

This commit is contained in:
Joel Sherrill
2000-01-05 18:30:09 +00:00
parent f388d36d84
commit db6ec79e6c
2 changed files with 8 additions and 2 deletions

View File

@@ -84,8 +84,11 @@ CORE_mutex_Status _CORE_mutex_Surrender(
the_mutex->nest_count--;
if ( the_mutex->nest_count != 0 )
if ( the_mutex->nest_count != 0 ) {
if ( the_mutex->Attributes.allow_nesting )
return( CORE_MUTEX_STATUS_SUCCESSFUL );
return( CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED );
}
_Thread_Executing->resource_count--;
the_mutex->holder = NULL;

View File

@@ -84,8 +84,11 @@ CORE_mutex_Status _CORE_mutex_Surrender(
the_mutex->nest_count--;
if ( the_mutex->nest_count != 0 )
if ( the_mutex->nest_count != 0 ) {
if ( the_mutex->Attributes.allow_nesting )
return( CORE_MUTEX_STATUS_SUCCESSFUL );
return( CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED );
}
_Thread_Executing->resource_count--;
the_mutex->holder = NULL;