Boost logo

Boost :

Subject: [boost] [future N2561] Implementation comments
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-12-03 04:33:17


on the current Future (N2561) library proposal the promise protect the value setting/getting from multiple threads using a lock, but the lock do not protect the future initialization (lazy_init()).

        void set_value(typename detail::future_traits<R>::source_reference_type r)
            boost::lock_guard<boost::mutex> lock(future->mutex);
                throw promise_already_satisfied();

I'm wondering if we don't need to extend the protection or avoid the lazy initialization? I'm missing something?

BTW, Is it safe to take the address of a promise? If not, why not delete the operator&()?


Boost list run by bdawes at, gregod at, cpdaniel at, john at