cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and Visual Studio 2005 - gmtime_r

From: Jamie Lokier <jamie_at_shareable.org>
Date: Sun, 25 Feb 2007 21:33:45 +0000

sherman wilcox wrote:
> That sentence raises a question, what is this Microsoft recommended
> way he mentions? I tend to stick to beginthread/_beginthreadex. There
> is the Win32 CreateThread call, but I think most people use
> _beginthreadex.

The recommended way is _beginthreadex / _endthreadex.

Don't use CreateThread. It's a kernel call, and won't duplicate the
run-time library's memory properly.

Don't use _beginthread / _endthread (or be careful with them). The
handle is closed by _endthread (or by the thread's function
returning), so the handle returned by _beginthread can become invalid,
perhaps even before the caller runs.

-- Jamie
Received on 2007-02-25