Boost logo

Boost :

From: Carl Daniel (cpdaniel_at_[hidden])
Date: 2001-11-17 11:33:26


From: "Peter Dimov" <pdimov_at_[hidden]>
> In order to make shared_ptr thread safe (w.r.t. reference counting) we need
> an atomic_counter type, with the following operations defined:
>

[snip]

> namespace win32
> {
> extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(long
> *);
> extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement(long
> *);
> }
>

It's probably be worth noting that InterlockedIncrement/decrement on NT 3.5.1 and Windows 95 does not necessarily return
the new count. It returns 0 if the the result was 0, a negative number if the count was negative, a positive number if
the count was positive.

-cd


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