Alessandro Nardin commented on a discussion on cpukit/posix/src/aio_suspend.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_116975 > + /* Initialize suspendcb */ > + suspendcbp = malloc( sizeof( rtems_aio_suspendcb ) ); > + if ( suspendcbp == NULL ) { > + rtems_set_errno_and_return_minus_one( ENOMEM ); > + } > + > + result = pthread_mutex_init( &suspendcbp->mutex, NULL ); > + if ( result != 0 ) { > + free( suspendcbp ); > + if ( errno == ENOMEM ) { > + rtems_set_errno_and_return_minus_one( ENOMEM ); > + } > + rtems_set_errno_and_return_minus_one( EAGAIN ); > + } > + > + pthread_mutex_lock( &suspendcbp->mutex ); I need to lock the suspendcb before making the various requests pointing to it in the for loop. This avoids having the rtems_aio_update_suspendcbp called before all the requests are modified, since it could cause some errors. I could move the lock down near line 97, but I have a concern that Doxygen might detect it as a problem since I would then be modifying the suspendcb without holding the lock. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_116975 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
