> On Dec. 2, 2013, 5:11 p.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/include/process/shared.hpp, lines 180-181
> > <https://reviews.apache.org/r/15866/diff/1/?file=391315#file391315line180>
> >
> >     If it's unique, how is this possible? To my knowledge, this is only 
> > possible if a Shared instance is "shared" via pointers (e.g., Shared<T>*). 
> > Maybe we should disallow getting the address of a Shared<T>?

Ben, good question. This is how this could have happened:

Shared<int> shared(new int(42));
Shared<int> shared2(foo);

Future<Owned<int> > owned = shared.own(); // 'shared2' is still holding the 
pointer.

int* raw = shared2.release(); // Make sure this does not happen.


- Jie


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15866/#review29572
-----------------------------------------------------------


On Nov. 27, 2013, 1:05 a.m., Jie Yu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15866/
> -----------------------------------------------------------
> 
> (Updated Nov. 27, 2013, 1:05 a.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Allow an object managed by a Shared pointer to be released.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/shared.hpp e0c7991 
>   3rdparty/libprocess/src/tests/shared_tests.cpp 860a9aa 
> 
> Diff: https://reviews.apache.org/r/15866/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 3rdparty/libprocess/tests --gtest_repeat=1000 --gtest_filter=Shared.*
> 
> 
> Thanks,
> 
> Jie Yu
> 
>

Reply via email to