Messages in this thread | | | Subject | Re: [PATCH] CPU hotplug, freezer: Fix bugs in CPU hotplug call path | From | Peter Zijlstra <> | Date | Mon, 03 Oct 2011 12:03:35 +0200 |
| |
On Mon, 2011-10-03 at 01:14 +0530, Srivatsa S. Bhat wrote: > +static atomic_t tasks_frozen = ATOMIC_INIT(0); > + > +void set_tasks_frozen_flag(void) > +{ > + atomic_set(&tasks_frozen, 1); > +} > + > +void clear_tasks_frozen_flag(void) > +{ > + atomic_set(&tasks_frozen, 0); > +} > + > +int tasks_are_frozen(void) > +{ > + int ret; > + ret = atomic_read(&tasks_frozen); > + return ret; > +}
What's the point of using atomic_t here? Neither set nor read are actually atomic ops.
| |