1<?xml version="1.0" encoding="utf-8"?> 2<!DOCTYPE section PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" 3 "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> 4<!-- 5Copyright Douglas Gregor 2001-2004 6Copyright Frank Mori Hess 2007-2009 7 8Distributed under the Boost Software License, Version 1.0. (See accompanying 9file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 10--> 11<section last-revision="$Date: 2007-06-12 14:01:23 -0400 (Tue, 12 Jun 2007) $" id="signals2.faq"> 12 <title>Frequently Asked Questions</title> 13 14 <using-namespace name="boost::signals2"/> 15 <using-namespace name="boost"/> 16 17 <qandaset> 18 <qandaentry> 19 <question> 20 <para>Don't noncopyable signal semantics mean that a class 21 with a signal member will be noncopyable as well?</para> 22 </question> 23 <answer> 24 <para>No. The compiler will not be able to generate a copy 25 constructor or copy assignment operator for your class if it 26 has a signal as a member, but you are free to write your own 27 copy constructor and/or copy assignment operator. Just don't 28 try to copy the signal.</para> 29 </answer> 30 </qandaentry> 31 <qandaentry> 32 <question> 33 <para>Is Boost.Signals2 thread-safe?</para> 34 </question> 35 <answer> 36 <para> 37 Yes, as long as the Mutex template parameter is not set to 38 a fake mutex type like <classname>boost::signals2::dummy_mutex</classname>. 39 Also, if your slots depend on objects which may be destroyed concurrently 40 with signal invocation, you will need to use automatic connection management. 41 That is, the objects will need to be owned by 42 <classname>shared_ptr</classname> and passed to the slot's 43 <methodname alt="signals2::slot::track">track</methodname>() method before the slot is connected. 44 The <classname>signals2::trackable</classname> scheme of automatic connection management 45 is NOT thread-safe, and is only provided to ease porting of single-threaded 46 code from Boost.Signals to Boost.Signals2. 47 </para> 48 <para>See the documentation section on <link linkend="signals2.thread-safety">thread-safety</link> 49 for more information. 50 </para> 51 </answer> 52 </qandaentry> 53 </qandaset> 54</section> 55