curl-library
Re: Simple curl C++ class
Date: Sat, 19 Jan 2008 18:55:27 +0100
Am Wed, 16 Jan 2008 23:57:38 +0100 schrieb Andreas Volz:
> Hello,
>
> for a special need a wrote a Download class with C++. It creates a
> thread, downloads files in the background and informs the caller after
> finishing. Optional I've a blocking mode to wait until it finish in
> the caller thread.
>
> I wrote a lot of unit tests for the class and all except one pass
> (waitOnFinishTest blocks). After searching the problem for some days
> I'm sticking a little.
>
> Perhaps I used too much mutexes and conditions and the locking code
> could be much simplified.
>
> Download.h
> http://pastebin.org/15720
>
> Download.cpp:
> http://pastebin.org/15718
>
> DownloadTest.cpp
> http://pastebin.org/15721
>
> And here the unit test running log:
> http://pastebin.org/15724
>
> Perhaps someone could review my code and see a problem. I would be
> very thankful for any hints.
Forget it. I solved the problem by reworking the complete locking code.
regards
Andreas
Received on 2008-01-19