OpenCL: endless loop in the kernel code

In the kernel code I have a endless loop like this one:

while (flag);

During the time when the kernel is in this loop I can manage the buffers from the host and
as soon as I completed I can change the flag.
The flag is volatile global variable.

My problem is when I call

clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_uint), (void *)&info, NULL);

it never returns. Is it a bug?

I tried many times to put endless while loop into the kernel but it always caused me problem.
Is there any way to suspend the workers until I manage the buffers on the host?