Skip to content

Ensure fdtable seq is assigned atomically#329

Open
liujinhui-job wants to merge 1 commit into
Xilinx-CNS:masterfrom
liujinhui-job:fix_fdtable_seq_no_atomic
Open

Ensure fdtable seq is assigned atomically#329
liujinhui-job wants to merge 1 commit into
Xilinx-CNS:masterfrom
liujinhui-job:fix_fdtable_seq_no_atomic

Conversation

@liujinhui-job

Copy link
Copy Markdown

When two threads concurrently invoke the socket function, the absence of
lock protection in citp_fdinfo_init may occasionally result in identical
sequence numbers (seq) being assigned to different fdi entries.

This change replaces the non-atomic increment with __sync_fetch_and_add
to guarantee uniqueness of seq in a multi-threaded environment.

When two threads concurrently invoke the socket function, the absence of lock protection in citp_fdinfo_init may occasionally result in identical sequence numbers being assigned. Use __sync_fetch_and_add to guarantee atomicity.
@liujinhui-job liujinhui-job requested a review from a team as a code owner May 25, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant