Alessandro Nardin commented on a discussion on cpukit/posix/src/aio_suspend.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_116976 > + r_chain = rtems_aio_search_fd( idle_req_chain, list[i]->aio_fildes, 0 > ); > + } > + > + /** If not found continue */ > + if ( r_chain == NULL ) { > + continue; > + } > + > + /* Search request in fd_chain */ > + request = rtems_aio_search_in_chain( list[i], &r_chain->perfd ); > + > + if ( request != NULL ) { > + if ( request->suspendcbp == NULL ) { > + request->suspendcbp = suspendcbp; > + } > + suspendcbp->requests_left++; Yes, this is an error. That part of the code handles the case where a request is involved in more than one suspend call. I have changed it and now i think it works, although maybe there are better solutions. Now the code is as follows: ``` if ( request->suspendcbp == NULL ) { request->suspendcbp = suspendcbp; suspendcbp->requests_left++; } else { pthread_mutex_lock( request->suspendcbp->mutex ); if ( request->suspendcbp->notified == AIO_SIGNALED ) { pthread_mutex_unlock( request->suspendcbp->mutex ); rtems_aio_update_suspendcbp( request->suspendcbp ); request->suspendcbp = suspendcbp; suspendcbp->requests_left++; } else{ thread_mutex_unlock( request->suspendcbp->mutex ); } } ``` If `request->suspendcbp == NULL`, I can simply set `request->suspendcbp` to the new suspendcb. If `request->suspendcbp != NULL`, it means that the request has been involved in another suspend request. There are now two cases: 1. If the other suspendcb has yet to generate the signal, I don't need to do anything since the completion of the request will generate the signal. 2. However, if the suspendcbp has already generated a signal, I update it and then set `request->suspendcbp` to the new suspendcb. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_116976 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list bugs@rtems.org http://lists.rtems.org/mailman/listinfo/bugs