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

lib: dlt thread-safe with mutex errorcheck #741

Merged
merged 1 commit into from
Mar 24, 2025
Merged

Conversation

minminlittleshrimp
Copy link
Collaborator

This mutex type allow checking on recursive locking, unlock without lock hold, double unlock. Hence add the checking in MACRO.

+-------------------------------------------+-------------+
| Scenario | ERRNO |
+---------------+-------------------------------+---------+
| Same thread | Lock twice - recursive lock | EDEADLK |
| | Unlock without holding lock | EPERM |
+---------------+-----------------------------+-----------+
| Multithread | Unlock without holding lock | EPERM |
+---------------+-----------------------------+-----------+

This mutex type allow checking on recursive locking,
unlock without lock hold, double unlock. Hence add the
checking in MACRO.

+-------------------------------------------+---------+
| Scenario                                  | ERRNO   |
+-------------+-----------------------------+---------+
| Same thread | Lock twice - recursive lock | EDEADLK |
|             | Unlock without holding lock | EPERM   |
+-------------+-----------------------------+---------+
| Multithread | Unlock without holding lock | EPERM   |
+-------------+-----------------------------+---------+

Signed-off-by: LUU QUANG MINH <[email protected]>
@minminlittleshrimp
Copy link
Collaborator Author

Hello @lti9hc
Please review and approve to merge if no further discussion.

@lti9hc lti9hc merged commit a04f5ed into master Mar 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants