device jobs in calibre are in the main process. In a plugin it's up to you to decide if you want thread or process based background jobs. The existing lock is single process and I dont think I want to make it an IPC lock as the overhead for that is too large.
So either use thread based background jobs in the plugin or simply get a write lock on the temp db path in your plugin. You can do so by opening a sqline connection to it and starting a trnsaction. sqlite IIRC is single writer so that should serve as a fine IPC lock.
|