On Wed, Apr 01, 2015 at 02:53:28AM +0300, Ilya Verbin wrote: > +/* Similar to gomp_fatal, but release mutexes before. */ > + > +static void > +gomp_fatal_unlock (const char *fmt, ...) > +{ > + int i; > + va_list list; > + > + for (i = 0; i < num_devices; i++) > + gomp_mutex_unlock (&devices[i].lock);
This is wrong. Calling gomp_mutex_unlock on a lock that you don't have locked is undefined behavior. You really should unlock it in the caller which should be aware which 0/1/2 locks it holds. > + gomp_mutex_unlock (®ister_lock); Jakub