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
Deadlock on C function fsw_destroy_session
if fsw_start_monitor
was called.
#137
Comments
What about line 865:
where the mutex is released before invoking:
Please, feel free to reopen the issue if you have more information to add. |
By session mutex, I meant https://github.com/emcrisostomo/fswatch/blob/master/libfswatch/src/libfswatch/c/libfswatch.cpp#L857.
|
I've patched the develop branch and now the session mutex is released before starting the monitor. Would you please test it? |
In my scenario, I have two threads. The second thread will be running the |
By the way, if you don't mind me asking. Why did you choose the handle approach to identify the sessions in the C API? |
Thanks.
Please see #143. Basically, a monitor should be stopped explicitly by calling You can try out the |
A choice that backfired. I already made that refactoring on |
This:
and #143 should be enough to close this issue. |
Using |
fsw_start_monitor
will acquire the session mutex and will invokesession->monitor->start()
with this mutex locked. The only way to stop the monitor (and thus release the mutex) using the C bindings is to destroy the session, but thefsw_destroy_session
will also try to acquire the mutex.An application that tries to stop the monitoring by destroying the session will deadlock.
The text was updated successfully, but these errors were encountered: