Sebastian Huber created a merge request: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1609

Project:Branches: sebhub/rtems:up/once-memory-order-6 to rtems/rtos/rtems:6
Author: Sebastian Huber

## Summary

Issue #5841: Backport of #5840 to 6

**Problem:** The acquire fence of `_Once()` precedes the load of the
once state, so it orders nothing which a caller of the fast path reads
afterwards. The fast path also reads the plain `unsigned char` state
without the mutex while other threads write it.

**Fix:** The backport of the two commits of !1608. `Atomic_Uchar`
follows the style of `<rtems/score/atomic.h>` in 6. The SPDX line of
`once.c` keeps its form of 6.

## Test

No RTEMS 6 toolchain was available. Both changed files compile
without new warnings with GCC 16 against the headers of 6, for
`sparc` without and with `RTEMS_SMP`. The new operations compile in
C++17 and C99.

## AI Details
<!-- Make sure you have read our statement at 
https://www.rtems.org/generative-ai/ -->

### Prompt used

None as a single prompt. The work was done in an interactive Claude Code 
session on the RTEMS tree. The task was to review the specification of 
`pthread_once()`, to compare its behaviour with POSIX and glibc and to fix the 
defects found. Each change was directed and reviewed.

### AI model used

Claude Opus 5.5 (claude-opus-5-5), through Claude Code.

### How AI was used for the contribution

- ( ) Formatting
- ( ) Test creation.
- (x) Code comments.
- ( ) The entire contribution was generated using AI
- ( ) AI code completion such as Copilot in VSCode.

The backport and the commit messages were produced in that session under my 
direction.

### Access

I have not used a product which claims copyright in its output, and I have 
legitimate access to the one I used.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1609
You're receiving this email because of your account on gitlab.rtems.org. 
Unsubscribe from this thread: 
https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-2aywe0jjmu2bt3qdgywkkrud6-1d/unsubscribe
 | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | 
Help: https://gitlab.rtems.org/help


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

Reply via email to