[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Race condition
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Race condition |
Date: |
Sat, 27 Jun 2015 22:18:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 |
Hi!
Interesting, SVN 36014 should fix this.
Happy hacking!
Christian
On 06/27/2015 07:25 PM, Markus Doppelbauer wrote:
> Hello,
>
> I think there is a race condition and I have no clue how to fix it:
>
> Main-Thread calls "MHD_quiesce_daemon()"
> Main-Thread sleeps until last connection is closed
> Poll-Thread wakes up the Main-Thread from "MHD_OPTION_NOTIFY_CONNECTION"
> because of "MHD_CONNECTION_NOTIFY_CLOSED"
> Main-Thread calls
> "MHD_get_daemon_info(MHD_DAEMON_INFO_CURRENT_CONNECTIONS)"
> and gets "1 connection"
> Poll-Thread removes the connection-struct
> Main-Thread sleeps forever (there are "0 connections" now)
>
> Would it be possible to call "MHD_CONNECTION_NOTIFY_CLOSED" after
> decrement
> of the daemon-connection-counter?
>
> Thanks a lot
> Markus
>
>
>
>
signature.asc
Description: OpenPGP digital signature