> On Dec. 2, 2016, 10:16 a.m., Benjamin Bannier wrote:
> > 3rdparty/stout/include/stout/posix/os.hpp, line 480
> > <https://reviews.apache.org/r/54291/diff/1/?file=1574565#file1574565line480>
> >
> > We should be able to use a simple function-local static here and avoid
> > the global leak of `mutex`, e.g.,
> >
> > static std::mutex mutex;
>
> Jie Yu wrote:
> We use pointer here to avoid global non-POD data.
This sounds like a very useful additon to the coding standard. Currently the
code base seems to be split regarding the right pattern, e.g., overly
simplistic grep patterns give
3rdparty/libprocess/src/clock.cpp:static recursive_mutex* timers_mutex =
new recursive_mutex();
3rdparty/libprocess/src/libevent.cpp:static std::mutex* functions_mutex =
new std::mutex();
3rdparty/libprocess/src/process.cpp: static std::mutex* prefixes_mutex =
new std::mutex();
3rdparty/libprocess/src/process.cpp:static std::mutex* socket_mutex = new
std::mutex();
3rdparty/libprocess/src/process.cpp:static std::recursive_mutex*
filterer_mutex = new std::recursive_mutex();
3rdparty/stout/include/stout/posix/os.hpp: static std::mutex* mutex = new
std::mutex;
and
src/authentication/cram_md5/auxprop.hpp: static std::mutex mutex;
src/hook/manager.cpp:static std::mutex mutex;
src/linux/fs.cpp: static std::mutex mutex;
src/module/manager.hpp: static std::mutex mutex;
src/tests/containerizer.cpp: static std::mutex mutex;
- Benjamin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54291/#review157711
-----------------------------------------------------------
On Dec. 5, 2016, 6:34 a.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54291/
> -----------------------------------------------------------
>
> (Updated Dec. 5, 2016, 6:34 a.m.)
>
>
> Review request for mesos, Benjamin Hindman and Kevin Klues.
>
>
> Bugs: MESOS-6470
> https://issues.apache.org/jira/browse/MESOS-6470
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Added os::ptsname to stout.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/posix/os.hpp
> c37e64db662ba3cee83d2f55de0f9d71ad72c038
>
> Diff: https://reviews.apache.org/r/54291/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>