Skip to content

Commit

Permalink
staging: tidspbridge: make sync_wait_on_event interruptible
Browse files Browse the repository at this point in the history
So that avoid non-killable process.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
  • Loading branch information
Guzman Lugo, Fernando authored and Omar Ramirez Luna committed Feb 5, 2011
1 parent ebf5382 commit 4097c49
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/staging/tidspbridge/include/dspbridge/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,22 @@ void sync_set_event(struct sync_object *event);
* This functios will wait until @event is set or until timeout. In case of
* success the function will return 0 and
* in case of timeout the function will return -ETIME
* in case of signal the function will return -ERESTARTSYS
*/

static inline int sync_wait_on_event(struct sync_object *event,
unsigned timeout)
{
return wait_for_completion_timeout(&event->comp,
msecs_to_jiffies(timeout)) ? 0 : -ETIME;
int res;

res = wait_for_completion_interruptible_timeout(&event->comp,
msecs_to_jiffies(timeout));
if (!res)
res = -ETIME;
else if (res > 0)
res = 0;

return res;
}

/**
Expand Down

0 comments on commit 4097c49

Please sign in to comment.