libheif icon indicating copy to clipboard operation
libheif copied to clipboard

crashes: add api for turning off multithreading

Open dk opened this issue 2 years ago • 6 comments

Applications that would like to have a tight control over usage of threads may crash if implicit multithreading is used by libheif. While 3rd party installations may configure libheif with multithreading, and explicit call to heif_global_set_multithreading(0) or something similar would be very much appreciated for these

dk avatar Apr 28 '22 08:04 dk

There is no api function to turn off multithreading, but there is a configure option to do so. This also excludes importing threading-related types (mutex, thread) which is also useful if they aren't available.

farindk avatar Apr 28 '22 08:04 farindk

here I quickly cooked a patch to demonstrate what I mean: not the compile-time unavailablilty, but the runtime control

dk avatar Apr 28 '22 08:04 dk

Thanks. Can you submit the patch as a pull request?

farindk avatar Apr 28 '22 09:04 farindk

Oh, I see you put it into the other PR. Never mind, I'll get it from there.

farindk avatar Apr 28 '22 09:04 farindk

Thank you! It's the githubs way of doing things, apparently, it automatically assumes the subsequent commits belong to the same pr/pull requests.

dk avatar Apr 28 '22 09:04 dk

You would have to make separate branches for this to work as two separate PRs. But don't mind. This patch is simple enough so that we don't have to split it.

farindk avatar Apr 28 '22 09:04 farindk