> On Oct. 8, 2014, 1:17 a.m., Michael Park wrote:
> > src/module/manager.hpp, lines 95-105
> > <https://reviews.apache.org/r/25848/diff/17/?file=714903#file714903line95>
> >
> >     I would suggest changing these to be static functions that return 
> > static singletons as per 
> > [MESOS-1023](https://issues.apache.org/jira/browse/MESOS-1023). Something 
> > like,
> >     
> >     ```cpp
> >     static pthread_mutex_t &mutex() {
> >       static pthread_mutex_t singleton = PTHREAD_MUTEX_INITIALIZER;
> >       return singleton;
> >     }
> >     ```
> 
> Benjamin Hindman wrote:
>     Maybe I'm missing something here, but how does this help? The destructors 
> will still get called for static variables in functions (even static 
> functions).

The difference is that initialization order of global/static member variables 
across translation units are non-determistic. In this case, the variables 
aren't accessible from another translation unit, but we might make one of them 
`public` in the future.


- Michael


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


On Oct. 8, 2014, 6:31 a.m., Kapil Arya wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25848/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2014, 6:31 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Niklas Nielsen, 
> and Timothy St. Clair.
> 
> 
> Bugs: MESOS-1384
>     https://issues.apache.org/jira/browse/MESOS-1384
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Adding a first class primitive, abstraction and process for dynamic library 
> writing and loading can make it easier to extend inner workings of Mesos. 
> Making it possible to have dynamic loadable resource allocators, isolators, 
> containerizes, authenticators and much more.
> 
> 
> Diffs
> -----
> 
>   include/mesos/module.hpp PRE-CREATION 
>   src/Makefile.am c62a974dcc80f3c3dd6060aee51f8367a0abe724 
>   src/examples/example_module_impl.cpp PRE-CREATION 
>   src/examples/test_module.hpp PRE-CREATION 
>   src/messages/messages.proto 9ff06b38086010df362036c695a5222371f70f4d 
>   src/module/manager.hpp PRE-CREATION 
>   src/module/manager.cpp PRE-CREATION 
>   src/tests/master_tests.cpp 705e5f2c0f9d693946e722cef63f38f3bff0d46b 
>   src/tests/module_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/25848/diff/
> 
> 
> Testing
> -------
> 
> Ran make check with added tests for verifying library/module loading and 
> simple version check.
> 
> 
> Thanks,
> 
> Kapil Arya
> 
>

Reply via email to