On Wed, Oct 31, 2012 at 10:41 AM, Paolo Bonzini wrote:
> Il 30/10/2012 20:13, Stefan Hajnoczi ha scritto:
>> On Fri, Oct 26, 2012 at 04:05:49PM +0200, Paolo Bonzini wrote:
>>> +static void event_notifier_ready(EventNotifier *notifier)
>>> +{
>>> +ThreadPoolElement *elem, *next;
>>> +
>>> +
Il 30/10/2012 20:13, Stefan Hajnoczi ha scritto:
> On Fri, Oct 26, 2012 at 04:05:49PM +0200, Paolo Bonzini wrote:
>> +static void event_notifier_ready(EventNotifier *notifier)
>> +{
>> +ThreadPoolElement *elem, *next;
>> +
>> +event_notifier_test_and_clear(notifier);
>> +restart:
>> +QL
On Fri, Oct 26, 2012 at 04:05:49PM +0200, Paolo Bonzini wrote:
> +static void event_notifier_ready(EventNotifier *notifier)
> +{
> +ThreadPoolElement *elem, *next;
> +
> +event_notifier_test_and_clear(notifier);
> +restart:
> +QLIST_FOREACH_SAFE(elem, &head, all, next) {
> +if (
Add a generic thread-pool. The code is roughly based on posix-aio-compat.c,
with some changes, especially the following:
- use QemuSemaphore instead of QemuCond;
- separate the state of the thread from the return code of the worker
function. The return code is totally opaque for the thread pool