26 May
2015
26 May
'15
1:31 p.m.
Giovanni Piero Deretta wrote:
You need to protect concurrent calls to then...
Hm, good point, I hadn't thought of that. Note however that if remove promise::get_future and create a promise/future pair in one go, I can then in principle check that the future is unique and omit the mutex lock.
You might as well use it to protect the refcount.
Eh, no. Refcounts have been protecting themselves for decades. :-)