Atomic block or transactions in CUDA

Hi,

how can I create an atomic block or transactions in CUDA?

The following method should be atomic.

__device__ __host__ void calculations(int value) {
  statement1
  statement2
  statement3
}

Only one thread should be able to execute it. (other threads will be blocked)

I know about the atomic operations of CUDA but I want a whole block or method to be atomic?

atomic {
...
}

How can I solve this in CUDA?
Should I use semaphores using atomicAdd?
Thanks!