Changed critical section for linux (sampler).