RTEMS | Add sem_clockwait() support to RTEMS (!669)

Sebastian Huber (@sebhub) gitlab at rtems.org
Thu Sep 11 07:59:08 UTC 2025




Sebastian Huber started a new discussion on cpukit/posix/src/semclockwait.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/669#note_130759

 > +  Thread_Control       *executing;
 > +  unsigned int          count;
 > +
 > +  POSIX_SEMAPHORE_VALIDATE_OBJECT( _sem );
 > +
 > +  sem = _Sem_Get( &_sem->_Semaphore );
 > +  _Thread_queue_Context_initialize( &queue_context );
 > +  _Thread_queue_Context_ISR_disable( &queue_context, level );
 > +  executing = _Sem_Queue_acquire_critical( sem, &queue_context );
 > +
 > +  count = sem->count;
 > +  if ( RTEMS_PREDICT_TRUE( count > 0 ) ) {
 > +    sem->count = count - 1;
 > +    _Sem_Queue_release( sem, level, &queue_context );
 > +    return 0;
 > +  } else {

Since you return in the `if`, you don't need this `else`.

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250911/431b2ba2/attachment-0001.htm>


More information about the bugs mailing list