On Wed, Apr 01, 2015 at 15:20:25 +0200, Jakub Jelinek wrote: > On Wed, Apr 01, 2015 at 04:14:05PM +0300, Ilya Verbin wrote: > > I was worried about the following scenario: > > 1. Thread 1 in GOMP_target locks device 1. > > 2. Thread 2 in GOMP_target locks device 2 and calls gomp_fatal. > > 3. GOMP_offload_unregister will wait for device 1, even device 2 is > > unlocked. > > How is that different from > 1. Thread 1 in GOMP_target locks device 1. > 2. Thread 2 calls exit. > ? I mean when you unlock the device and register locks if you own them > before gomp_fatal.
Yeah, it's the same situation. > > Here is patch, which unlocks proper mutexes in the caller, as you suggested. > > make check-target-libgomp passed. > > LGTM with proper ChangeLog entry. When should I commit it into trunk? Without the corresponding PTX part, offloading to PTX will not work. -- Ilya