Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlt_user: race data happens between threads #588

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

minminlittleshrimp
Copy link
Collaborator

@minminlittleshrimp minminlittleshrimp commented Jan 26, 2024

The current implementation of signaling mechanism
with binary semaphore is used to lock the libdlt ring buffer.
However, this cannot perform a correct locking.
While libdlt ring buffer is being freed by atexit_handler thread,
logging still happens in other threads dereferencing NULL pointers.

This fix replaces the current binary semaphore with a mutex lock,
folowing the locking mechanism.

The current implementation of signaling mechanism
with binary semaphore is used to lock the libdlt ring buffer.
However, this cannot perform a correct locking. While libdlt
ring buffer is being freed by atexit_handler thread, logging
still happens in other threads dereferencing NULL pointers.

This fix replaces the current binary semaphore with a mutex lock,
folowing the locking mechanism.

Signed-off-by: LUU QUANG MINH <[email protected]>
@michael-methner michael-methner merged commit 97b8793 into master Jan 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants