Skip to content

Mutex encapsulation for SANE function calls

Volodymyr Zolotopupov requested to merge vvova/ksanecore:mtsafe into master

SANE library isn't thread-safe. It cannot be used in different threads. Additionally, polling properties in the UI thread causes interface lagging. Move polling to a separate thread and introduce mutex protection.

I know that this is too big merge, but it's problematic to break it down into smaller commits.

What is fixed:

  • Crash at startup due to interference FindSaneDevicesThread SANE calls with others in the main thread.
  • Potential crashes during scanning, as it is also separated thread.
  • Laggy interface with remote PIXMA USB scanner(connected to another Linux machine with SANE server).

Base functionality seems ok, but will be good if someone will also test.

Merge request reports