Hi all,
I'm new here in the list, so this is my first message.
I'm building an application with Magick++, which does image manipulation
in normal single thread. But when saving, I create 4 separate threads,
which saves the image in 4 different dimensions in 4 different files.
I'm using threading library provided by Boost (1.34.0) which, I think,
is working well.
The problem is this: I get a crash few seconds after all the threads
have been started for saving images, which says about a failure in a C
assertion, here is the error (same error everytime):
xml2gif: magick/blob.c:3617: WriteBlob: Assertion `image->blob->type !=
UndefinedStream' failed.
Aborted
I'm using ImageMagick v6.3.7.9, and also tried v6.3.9.7, but the same
error persists. I'm using Gentoo, and that's the latest in the portage.
Here is the code that I use in C++ to save the image sequence in a file:
vector<Image> canvas;
{
boost::mutex::scoped_lock lock(mutex_);
canvas = getCanvasForSave(saveType);
}
writeImages(canvas.begin(), canvas.end(), *savePath);
Note that when I run in single thread mode, or I put the writeImages()
with the mutex in the scope above (which makes threading useless),
everything works fine without a single crash.
So, my question is: is there something that I should do, to make the
saving, more precisely writeImages() thread-safe?
Any help is appreciated.
Thanks.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users