Skip to content

proc/threads: let _proc_lockTry relock a recursive mutex#785

Merged
julianuziemblo merged 1 commit into
masterfrom
julianuziemblo/RTOS-1334
May 26, 2026
Merged

proc/threads: let _proc_lockTry relock a recursive mutex#785
julianuziemblo merged 1 commit into
masterfrom
julianuziemblo/RTOS-1334

Conversation

@julianuziemblo
Copy link
Copy Markdown
Contributor

@julianuziemblo julianuziemblo commented May 22, 2026

YT: RTOS-1334

Description

related: phoenix-rtos/libphoenix#477

Tests:
Depends-On: phoenix-rtos-tests:julianuziemblo/CI-676

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces recursive locking support in the _proc_lockTry function within proc/threads.c. It adds logic to increment a lock's depth if the current thread already owns a recursive lock. The review feedback identifies a missing overflow check for the lock depth, suggesting an assertion, and recommends using the equality operator for type checks to ensure consistency with the repository's style.

Comment thread proc/threads.c Outdated
Comment thread proc/threads.c Fixed
Comment thread proc/threads.c Fixed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Unit Test Results

10 585 tests  +42   9 915 ✅ +34   52m 48s ⏱️ + 1m 35s
   649 suites ± 0     670 💤 + 8 
     1 files   ± 0       0 ❌ ± 0 

Results for commit cdf9af4. ± Comparison against base commit 32d04db.

♻️ This comment has been updated with latest results.

@julianuziemblo julianuziemblo requested a review from etiaro May 22, 2026 12:04
Copy link
Copy Markdown
Contributor

@etiaro etiaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could try to share some of this code with _proc_lockSet, to reduce chance of such oversights in the future.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch 4 times, most recently from 44f0732 to cb14c80 Compare May 25, 2026 07:38
@julianuziemblo julianuziemblo requested a review from etiaro May 25, 2026 08:10
Comment thread proc/threads.c Outdated
Comment thread proc/threads.c Outdated
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch from cb14c80 to 2314c80 Compare May 25, 2026 09:16
@julianuziemblo julianuziemblo requested a review from etiaro May 25, 2026 09:52
Comment thread proc/threads.c Outdated
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch from 2314c80 to bf137f0 Compare May 25, 2026 12:57
Comment thread proc/threads.c Fixed
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch from bf137f0 to e79e524 Compare May 25, 2026 13:56
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1334 branch from e79e524 to cdf9af4 Compare May 25, 2026 14:12
@julianuziemblo julianuziemblo requested a review from etiaro May 25, 2026 14:30
Comment thread proc/threads.c
@julianuziemblo julianuziemblo merged commit 9c1d515 into master May 26, 2026
51 checks passed
@julianuziemblo julianuziemblo deleted the julianuziemblo/RTOS-1334 branch May 26, 2026 08:36
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.

4 participants