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
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/deinitcalls.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 andandand a global mutex