mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Review Request 54309: Fixed ownership semantics of `DynamicLibrary`.
Date Fri, 02 Dec 2016 15:45:20 GMT

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

Review request for mesos and Joseph Wu.


Bugs: MESOS-6672
    https://issues.apache.org/jira/browse/MESOS-6672


Repository: mesos


Description
-------

The class `DynamicLibrary` is a RAII wrapper around a handle to a
`dlopen`'ed library. To ensure consistent state any `dlopen`'ed library
will be `dlcose`'ed when the "owning" `DynamicLibrary` gets destructed
(e.g., when the wrapper goes out of scope, or when the library holding
a `static` `DynamicLibrary` gets unloaded).

This patch ensure that `DynamicLibraries` can be neither copy- nor
move-constructed. A copy constructor would lead to two wrappers
managing the same library handle which will lead to inconsistent state
(e.g., a library might be unloaded when a copy gets destructed even
though another copy still exists). While it might be possible to
implement a wrapper allowing move-construction, the current wrapper
does not support this.


Diffs
-----

  3rdparty/stout/include/stout/posix/dynamiclibrary.hpp 2b343222299c7ca09f919c527c7682f6aebb4439

  3rdparty/stout/include/stout/windows/dynamiclibrary.hpp cfa6c88d5d852292bcc931e0598f916833d490ba


Diff: https://reviews.apache.org/r/54309/diff/


Testing
-------

`make check` (default ubuntu-14)


Thanks,

Benjamin Bannier


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message