diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-06 12:09:28 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-06 12:09:28 +0200 |
commit | a7c84375db517769035080c8fed33b2f303fc42f (patch) | |
tree | 0183eae4e175fc12c7ecd8a67a66d723f1aced66 /toolkit/inc | |
parent | 119f78a4d99618ae1e788d70cd8aab012cf81d34 (diff) |
os141: allow the VCLXWindow to process arbitrary callbacks asynchronously, without a locked SolarMutex. Intended for UNO listeners.
Employ this mechanism for VCLXButton's actionPerformed callbacks, so we don't get threading problems in those
callbacks.
Normally, *each and every* UNO notification would need to happen without a SolarMutex, like VCLXWindow itself
already does this for mouse events and window enabled/disabled events. However, for each and every event which
we migrate to this new mechanism, we need to carefully evaluate which C++ clients might need to be adjusted. Java
clients don't have a problem with this, of course.
Diffstat (limited to 'toolkit/inc')
-rw-r--r-- | toolkit/inc/toolkit/awt/vclxwindow.hxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/toolkit/inc/toolkit/awt/vclxwindow.hxx b/toolkit/inc/toolkit/awt/vclxwindow.hxx index 97f36850dff9..6ad3c3ab6076 100644 --- a/toolkit/inc/toolkit/awt/vclxwindow.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindow.hxx @@ -51,6 +51,7 @@ #include <stdarg.h> #include <list> +#include <boost/function.hpp> class Window; class VclSimpleEvent; @@ -114,6 +115,23 @@ protected: ::cppu::OInterfaceContainerHelper& GetTopWindowListeners(); public: + typedef ::boost::function0< void > Callback; + +protected: + /** executes the given callback asynchronously + + At the moment the callback is called, the Solar Mutex is not locked. In particular, this implies that + you cannot rely on |this| not being disposed. However, you *can* rely on |this| being still alive (i.e. + having a ref count > 0). + + As a consequence, this can be used for doing listener notifications, using event multiplexers. Those multiplexers + care for the disposed state themself, and are alive as long as |this| is alive. + */ + void ImplExecuteAsyncWithoutSolarLock( + const Callback& i_callback + ); + +public: VCLXWindow( bool bWithDefaultProps = false ); ~VCLXWindow(); |