Prakhar Kumar commented on a discussion on cpukit/libblock/src/flashdisk.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/912#note_140407

 >  
 >    return RTEMS_SUCCESSFUL;
 >  }
 > +
 > +static void rtems_fdisk_cleanup_helper (rtems_flashdisk *fd, bool 
 > *mutex_initialized)
 > +{
 > +  uint32_t device;
 > +
 > +  if(fd == NULL)
 > +    return;
 > +  
 > +  if((*mutex_initialized) == false) {
 > +    (*mutex_initialized) = true;
 > +  } else {
 > +    rtems_mutex_destroy(&fd->lock);

I was looking at this 

https://docs.rtems.org/docs/main/c-user/self_contained_objects.html#mutex-destruction

" **DESCRIPTION:** Destroys theĀ `mutex`.

**NOTES:** In case the mutex is locked or still in use, then the result is 
unpredictable. "

It just tells about the mutex locked and still in use behaviour not about when 
it is initialized or not thats why i added the bool to track the initialization 
just to be cautious.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/912#note_140407
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to