You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Jie Yu <yu...@gmail.com> on 2013/11/27 02:05:24 UTC

Review Request 15866: Supported process::Shared::release().

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

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


Re: Review Request 15866: Supported process::Shared::release().

Posted by Jie Yu <yu...@gmail.com>.

> 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
> 
>


Re: Review Request 15866: Supported process::Shared::release().

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15866/#review29572
-----------------------------------------------------------



3rdparty/libprocess/include/process/shared.hpp
<https://reviews.apache.org/r/15866/#comment56939>

    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>?


- Benjamin Hindman


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
> 
>