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

suppress bu_log from multiple threads simultaneously #106

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

kennethsdavis
Copy link
Contributor

@kennethsdavis kennethsdavis commented Dec 12, 2023

There is a semaphore global to log.c that is intended to protect calls to bu_hook_call (via log_call_hooks). Because log_call_hooks can only be called if the log_hook_list is non-empty this semaphore only gets initialized when bu_log_add_hook is called the first time.

I considered the FIXME note at the top of log.c as a strong candidate for implementation from a design standpoint, but favored this solution because its development cost and risk are both low.

This pull request satisfies #100

@kennethsdavis
Copy link
Contributor Author

Testing was performed against 7.36.0 because main HEAD won't build brlcad.dll at the time of this comment (see #105). The sample application on #100 executes as expected after applying this change.

@starseeker starseeker requested a review from brlcad December 13, 2023 15:27
@kennethsdavis
Copy link
Contributor Author

I may be getting close to updating my brl-cad version. It would be nice to have this fix in the update. Is there anything I can do to help in the review of this PR?

@starseeker starseeker merged commit 659c5d1 into BRL-CAD:main Dec 19, 2024
@starseeker
Copy link
Member

I think this should be OK - I'll go ahead and merge. @brlcad let me know if you see any issues here.

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.

2 participants