FLI function (Sqlite) fails when called in display-callback
Hi Lispers,
I have a display-callback which calls some Sqlite functions via the FLI - specifically sqlite3_blob_open and sqlite3_blob_reopen, from the Sqlite incremental I/O API. I use the incremental I/O functions to open and iterate over blobs stored in the rows of an Sqlite database on disk. My wrapper for sqlite3_blob_reopen works fine when called from the Listener, but fails with an Sqlite I/O error when called from within an output-pane callback (this also happens for button callbacks). It will work, however, if I pass it to mp:process-run-function within the callback.
I have a display-callback which calls some Sqlite functions via the FLI - specifically sqlite3_blob_open and sqlite3_blob_reopen, from the Sqlite incremental I/O API. I use the incremental I/O functions to open and iterate over blobs stored in the rows of an Sqlite database on disk. My wrapper for sqlite3_blob_reopen works fine when called from the Listener, but fails with an Sqlite I/O error when called from within an output-pane callback (this also happens for button callbacks). It will work, however, if I pass it to mp:process-run-function within the callback.
This suggests that there is some kind of threading issue occurring (though Sqlite is thread-safe). Perhaps it's something relating to the thread that the callback runs in - my assumption was that this would just be the same thread as the CAPI window, but perhaps that's not right.
This behaviour seems rather odd, and not the kind of thing I would expect to happen when interfacing with Sqlite, which is normally extremely robust. Before I head over to the Sqlite list I thought I'd try here, just in case anybody has an inkling of what the problem might be. I can follow up with some code if need be.
Regards,
Christopher
This behaviour seems rather odd, and not the kind of thing I would expect to happen when interfacing with Sqlite, which is normally extremely robust. Before I head over to the Sqlite list I thought I'd try here, just in case anybody has an inkling of what the problem might be. I can follow up with some code if need be.
Regards,
Christopher