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

chore: add condvar for safe access to TRAY_ID #53

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented Dec 23, 2024

Important

Add TRAY_CONDVAR for safe access to TRAY_ID with synchronization in lib.rs.

  • Synchronization:
    • Add TRAY_CONDVAR using lazy_static! for safe access to TRAY_ID.
    • Introduce init_tray_id() to set TRAY_ID and notify all waiting threads.
    • Update get_tray_id() to wait for TRAY_ID initialization using TRAY_CONDVAR.

This description was created by Ellipsis for 10340e9. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 10340e9 in 1 minute and 3 seconds

More details
  • Looked at 46 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src-tauri/src/lib.rs:31
  • Draft comment:
    Consider using OnceLock instead of lazy_static! for TRAY_CONDVAR to maintain consistency and efficiency with TRAY_ID.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of lazy_static! is unnecessary for TRAY_CONDVAR since OnceLock is already used for TRAY_ID. OnceLock is sufficient for one-time initialization and is more efficient.

Workflow ID: wflow_as7niVcqYiTA9dl5


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@0xbrayo 0xbrayo merged commit 74066f4 into ActivityWatch:master Dec 23, 2024
5 checks passed
@0xbrayo 0xbrayo deleted the safe-sync branch January 8, 2025 17:02
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