Boost logo

Boost :

From: dmoore_at_[hidden]
Date: 2001-09-06 08:35:10


A review from a Windows-centric programmer:

1. Great, great, overall library
2. In call_once, the line:

swprintf(name, L"2AC1A572DB6944B0A65C38C4140AF2F4%X%X",
GetCurrentProcessId(), &flag);

Shouldn't you just generate a UUID for your unique naming prefix?

3. In many places in the code where there are resource allocation
problems, you attempt to do cleanup by calling CloseHandle() before
throwing the thread_resource_error() exeception (see
condition::condition in particular). Calling CloseHandle(NULL)
causes a Windows exception (C0000008) to be thrown, which will occur
before you get your chance to throw thread_resource_error().

4. In semaphore::up(), I hadn't seen the idiom of "!!" before.

    bool ret = !!ReleaseSemaphore(reinterpret_cast<HANDLE>(m_sema),
count, &p);

At first glance, I thought this was a bug (it's not), but it seems a
bit odd. Would a cast from BOOL to bool or a comment be more clear?

Regards,
Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk