Fixes issue #26, in the end spotted by massimo - for now fixed using gcc
extensions rather than also generically with a mutex.
{
case BABL_FORMAT:
components = format->format.components;
+
+#if 1
+ babl = __atomic_exchange_n (&format->format.image_template, NULL,
+ __ATOMIC_ACQ_REL);
+#else
+ /* todo: add a configure check for the above gcc extension and use
+ a mutex if we do not have it?
+ */
+ babl = NULL;
if (format->format.image_template != NULL) /* single item cache for speeding
up subsequent use of linear buffers
for subsequent accesses
{
babl = format->format.image_template;
format->format.image_template = NULL;
+ }
+#endif
+ if (babl)
+ {
for (i = 0; i < components; i++)
{
babl->image.data[i] = buffer + offset;