I run into an issue where I have a database connection that have quite a few
queries that were suspended due to managed priorities...
I have two threads, the control thread (UI), and a sqlite3 worker thread.
I want to use sqlite3_interrupt() to interrupt the statement that is executing
sqlite3_step() for the first time in the worker. It is mutex protected so I
already make sure that when sqlite3_interrupt() is called, my worker thread is
running sqlite3_step()...
However, the current sqlite3_interrupt() behavior is to interrupt all the
statements, including the ones that I suspended and running half-ways in the
background. I could make a separate database connection for each query, but the
ability for them to share data (e.g., temp tables) were limited.
So I wonder if I can call sqlite3_clear_interrupt() or similar in my worker
thread to limit the scope of statements being interrupted, so that only the
currently "executing" queries would be disposed... I understand it is kind of
dangerous to clear the flag in any other situation if it is not controlled, but
I only have one worker thread per db handle.
void sqlite3_clear_interrupt(sqlite3 *db)
{
db->u1.isInterrupted = 0;
}
Any thoughts would be helpful. Thanks!
Mi Chen
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users