BIND 10 master, updated. e3c5c430e69e4b3b2211421be2dc23723c4c40eb [master] use a wrapper for passing boost::function to io_service::post()
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri May 3 07:06:39 UTC 2013
The branch, master has been updated
via e3c5c430e69e4b3b2211421be2dc23723c4c40eb (commit)
from 9f92c87372c0a3b37fabb3ee1963dca5409ccde5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e3c5c430e69e4b3b2211421be2dc23723c4c40eb
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Fri May 3 00:05:44 2013 -0700
[master] use a wrapper for passing boost::function to io_service::post()
this works as a workaround for a build failure with SunStudio.
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiolink/io_service.cc | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/lib/asiolink/io_service.cc b/src/lib/asiolink/io_service.cc
index 0d791a1..aebafcb 100644
--- a/src/lib/asiolink/io_service.cc
+++ b/src/lib/asiolink/io_service.cc
@@ -24,6 +24,23 @@
namespace isc {
namespace asiolink {
+namespace {
+// A trivial wrapper for boost::function. SunStudio doesn't seem to be capable
+// of handling a boost::function object if directly passed to
+// io_service::post().
+class CallbackWrapper {
+public:
+ CallbackWrapper(const boost::function<void()>& callback) :
+ callback_(callback)
+ {}
+ void operator()() {
+ callback_();
+ }
+private:
+ boost::function<void()> callback_;
+};
+}
+
class IOServiceImpl {
private:
IOServiceImpl(const IOService& source);
@@ -64,7 +81,7 @@ public:
/// generalized.
asio::io_service& get_io_service() { return io_service_; };
void post(const boost::function<void ()>& callback) {
- io_service_.post(callback);
+ io_service_.post(CallbackWrapper(callback));
}
private:
asio::io_service io_service_;
More information about the bind10-changes
mailing list