This patch forces GOACC_LOCK to use locks in global memory regardless if the lock us for a worker or a gang. We were using a shared memory for worker locks, but we ran into an issue with that would sporadically involve deadlocks in worker reductions. We're still investigating that issue, but for the time being, global locks appear to work albeit with a lock contention penalty. I've applied this patch to gomp-4_0-branch. Cesar