File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -569,7 +569,14 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )
569569
570570 if ( type == RT_Object_Class_Mutex )
571571 {
572- uxReturn = ( ( rt_mutex_t ) pipc )-> value ;
572+ if ( ( ( rt_mutex_t ) pipc )-> owner == RT_NULL )
573+ {
574+ uxReturn = 1 ;
575+ }
576+ else
577+ {
578+ uxReturn = 0 ;
579+ }
573580 }
574581 else if ( type == RT_Object_Class_Semaphore )
575582 {
@@ -603,7 +610,14 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
603610
604611 if ( type == RT_Object_Class_Mutex )
605612 {
606- uxReturn = 1 - ( ( rt_mutex_t ) pipc )-> value ;
613+ if ( ( ( rt_mutex_t ) pipc )-> owner == RT_NULL )
614+ {
615+ uxReturn = 0 ;
616+ }
617+ else
618+ {
619+ uxReturn = 1 ;
620+ }
607621 }
608622 else if ( type == RT_Object_Class_Semaphore )
609623 {
You can’t perform that action at this time.
0 commit comments