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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kennethsdavis
Copy link

@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
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.

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