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

Mutex comment for init/deinit #447

Open
SamWindell opened this issue Jan 30, 2025 · 0 comments
Open

Mutex comment for init/deinit #447

SamWindell opened this issue Jan 30, 2025 · 0 comments

Comments

@SamWindell
Copy link
Contributor

SamWindell commented Jan 30, 2025

I might be misunderstanding something, but it seems there's a contradiction in the comments of entry.h regarding the need for a mutex in init/deinit calls.

With regards to how to handle init/deinit (near the top of the file):
the functions must be defensive, mutex locking and counting calls if undertaking non trivial non idempotent actions.
and
The most obvious implementation will maintain a static counter and a global mutex, increment the counter on each init, decrement it on each deinit, and only undertake the init or deinit action when the counter is zero.

But then the comments for init and deinit both say this: it is forbidden to call this function simultaneously from multiple threads. It is also forbidden to call it simultaneously with *any* other CLAP-related symbols from the DSO, including (but not limited to) deinit()

Can we clear up any ambiguity here?

I would suggest just removing these: mutex locking and and and a global mutex

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

No branches or pull requests

1 participant