Parametrisation by the Mutex module + remove use for condition #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think (might be wrong) that the condition and connection state `Used was useless and that protecting all call by a mutex seems enough to me. This PR removes the condition and replace the connection state by a boolean. It also offers a functor parametrized by the mutex module.
Remark : if you can avoid the fact that I had to copy the class type connection both in .ml (without comments) and in .mli,
I would be happy. Moving all type defs in sig.ml is not so nice for the generated documentation.
Remark : In asynch mode, it could have been useful to have a Used state, but in the code before this PR send_query or send_query_prepare got the mode back to `Free. Moreover, there is no way to know when the connection is free, that is when the user does not need the connection result anymore.