Skip to content

Commit fc4744f

Browse files
author
Cristy
committed
omp_init_lock() has undefined behavior if the lock is already init'ed @ ImageMagick#5360
1 parent ca18a05 commit fc4744f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

MagickCore/mutex.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static inline void DestroyMagickMutex(void)
5555
static inline void InitializeMagickMutex(void)
5656
{
5757
#if defined(MAGICKCORE_OPENMP_SUPPORT)
58-
omp_init_lock(&translation_unit_mutex);
58+
if (translation_unit_initialized == MagickFalse)
59+
omp_init_lock(&translation_unit_mutex);
5960
translation_unit_initialized=MagickTrue;
6061
#endif
6162
}

0 commit comments

Comments
 (0)