[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets |
Date: |
Wed, 20 Oct 2010 09:16:28 +0100 |
On Tue, Oct 19, 2010 at 6:42 PM, Arun R Bharadwaj
<address@hidden> wrote:
> +/**
> + * cancel_threadletwork_on_queue: Cancel a task queued on a Queue.
> + * @queue: The queue containing the task to be cancelled.
> + * @work: Contains the information of the task that needs to be cancelled.
> + *
> + * Returns: 0 if the task is successfully cancelled.
> + * 1 otherwise.
The return value comment doesn't correspond to how I read the code.
If the work was cancelled the code returns 1. Otherwise it returns 0.
> + */
> +int cancel_threadletwork_on_queue(ThreadletQueue *queue, ThreadletWork *work)
> +{
> + ThreadletWork *ret_work;
> + int ret = 0;
> +
> + qemu_mutex_lock(&(queue->lock));
> + QTAILQ_FOREACH(ret_work, &(queue->request_list), node) {
> + if (ret_work == work) {
> + QTAILQ_REMOVE(&(queue->request_list), ret_work, node);
> + ret = 1;
> + break;
> + }
> + }
> + qemu_mutex_unlock(&(queue->lock));
> +
> + return ret;
> +}
Stefan
- Re: [Qemu-devel] Re: [PATCH 1/3] Introduce threadlets, (continued)
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Venkateswararao Jujjuri (JV), 2010/10/19
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Balbir Singh, 2010/10/19
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Anthony Liguori, 2010/10/19
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Balbir Singh, 2010/10/19
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Venkateswararao Jujjuri (JV), 2010/10/19
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Balbir Singh, 2010/10/20
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Anthony Liguori, 2010/10/20
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Venkateswararao Jujjuri (JV), 2010/10/19
Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets,
Stefan Hajnoczi <=
Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Amit Shah, 2010/10/20
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Stefan Hajnoczi, 2010/10/20
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Anthony Liguori, 2010/10/20
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Amit Shah, 2010/10/22
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Stefan Hajnoczi, 2010/10/23
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Amit Shah, 2010/10/27
- Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework, Stefan Hajnoczi, 2010/10/27