Re: gtkmm 3.0 and libsigc++



W dniu 28 lipca 2010 17:49 użytkownik Chris Vine
<chris cvine freeserve co uk> napisał:
> If it helps, the way signal2 deals with locking is that it uses by
> default boost mutexes, but if a user has a single threaded program (or
> is using signal2 in a way which does not raise thread safety issues), a
> user can specify boost::signals2::dummy_mutex as the relevant template
> parameter type which makes all mutex operations a no-op.  If a similar
> approach were taken to libsigc++ that might keep everyone happy, and
> the default could be reversed for libsigc++.  That is, by default it is
> not thread safe and has no glib dependency; but it has a thread safe
> option which does have that dependency in any case where C++-0x
> mutexes are not available.

This is OK in principle, but it would mean making sigc::trackable a
template. Since many other types also derive from sigc::trackable, we
need a way of specifying the mutex type of e.g. sigc::signal without
adding an extra template parameter to it. How to solve this without
using #define?

Regards, Krzysztof


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]