summaryrefslogtreecommitdiff
path: root/examples/thread/dispatcher.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix exceptions thrown by Thread::create() and Threads::Thread::create.Kjell Ahlstedt2012-02-281-1/+1
| | | | | | | | | | | | | | | | | * glib/src/thread.ccg: create(): Call g_thread_try_new() instead of g_thread_new(). Throw a Glib::ThreadError when appropriate, instead of calling Glib::Error::throw_exception(), which would throw Glib::Threads::ThreadError. * glib/src/threads.ccg:create(): Call g_thread_try_new() instead of g_thread_new(). Remove parameter 'joinable'. * glib/src/threads.hg: Remove parameter 'joinable'. Remove comments about non-joinable threads and thread priorities. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: Remove parameter 'joinable' in calls to Glib::Threads::Thread::create(). Bug #640029.
* Add Glib::Threads::* in threads.h, deprecating everything in thread.hMurray Cumming2011-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * glib/src/filelist.am: * glib/src/thread.[hg|ccg]: Deprecate the whole file, adding deprecation doxygen comments to all API. * glib/src/threads.[hg|ccg]: A new Threads namespace containing equivalents for everything in thread.h, implemented using only non-deprecated glib API. This was necessary because we had to break the ABI to do this. * glib/glibmm.h: Include threads.h * glib/glibmm/main.[h|cc]: Added a wait() method overload that takes the new types, deprecating the existing wait() method. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: * examples/thread/threadpool.cc: * glib/glibmm/dispatcher.cc: * glib/glibmm/exceptionhandler.cc: * glib/glibmm/threadpool.[h|cc]: Use the new Glib::Threads::* types instead of thread.h.
* Avoid use of deprecated API in tests and examples.Murray Cumming2011-10-261-1/+1
| | | | | | | | | | | * tests/Makefile.am: * examples/Makefile.am: Disable deprecated API. * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: Remove calls to Glib::thread_init(), instead calling Glib::init() where that side-effect was also intended.
* Remove the reduced API options and code, as discussed on mailing list.Murray Cumming2010-05-311-4/+0
| | | | | | | | | * configure.ac: Removed the --enable-api-exceptions, --enable-api-properties, --enable-api-vfuncs and --enable-api-default-signal-handlers options. * build/reduced.m4: Removed. * tools/m4/*.m4: * tools/pm/Output.pm: Remove any use of ifdefs and auto_ptr for reduced API. * *.[hg|ccg|h|cc]: Remove the idefed code.
* Early spring cleaning. Also add a paragraph about Dispatcher on win32 toDaniel Elstner2007-01-201-62/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/glibmm/dispatcher.{cc,h}: Early spring cleaning. Also add a paragraph about Dispatcher on win32 to the documentation. (DispatchNotifyData): Remove the 'tag' member from the struct that was always set to 0xdeadbeef in order to detect memory corruption. This is pointless, as we already check the DispatchNotifier pointer sent across the pipe, which is a far better indicator of corruption anyway. (warn_failed_pipe_io): Remove the err_no parameter and retrieve errno respectively GetLastError() within the function instead. (DispatchNotifier::conn_io_handler_): Remove, as we now inherit from sigc::trackable. I verified that this doesn't cause problems with threading in this particular case. (DispatchNotifier::DispatchNotifier): If creating the pipe failed and exceptions are disabled, call at least warn_failed_pipe_io() instead of doing nothing at all. (DispatchNotifier::*): Rework the win32 implementation so that it matches more closely the Dispatcher semantics on Unix. This still needs testing by someone on win32, though. So far I only verified that it compiles with dummy definitions of the win32 API. Also, I accidentally located the real cause of the race condition Cedric experienced in bug #109966. It was a bug in my patch, rather than in the example code. * examples/thread/dispatcher.cc: Cleanup. In particular, get rid of the Glib::RefPtr<> abuse with non-Glib::Object types. I don't believe we endorse such usage officially, so it shouldn't be in the examples. svn path=/trunk/; revision=370
* Mark private functions as static, to stop them being exported in the API,Murray Cumming2006-04-121-1/+1
| | | | | | | | | | | | | | | 2006-04-12 Murray Cumming <murrayc@murrayc.com> * glib/glibmm/main.cc: * glib/glibmm/objectbase.cc: * glib/glibmm/property.cc: * glib/glibmm/ustring.cc: * glib/glibmm/value_custom.cc: * glib/src/spawn.ccg: Mark private functions as static, to stop them being exported in the API, to reduce the library code size slightly. * tools/m4/signal.m4: Make generated callback functions static, for the same reasons.
* Inherit signal handler objects from sigc::trackable. This is necessaryMurray Cumming2005-04-271-1/+1
| | | | | | | | | | | 2005-04-27 Murray Cumming <murrayc@murrayc.com> * examples/child_watch/main.cc: * examples/thread/dispatcher.cc: * examples/thread/thread.cc: * glib/glibmm/dispatcher.cc: Inherit signal handler objects from sigc::trackable. This is necessary with some libsigc++ patches, though not currently necessary with regular libsigc++.
* Removed the #ifdef for AIX, because sigc::bind now works on AIX.Murray Cumming2005-02-011-12/+0
| | | | | | | 2005-02-01 Murray Cumming <murrayc@murrayc.com> * examples/threadpool.cc, dispatcher.cc, dispatcher2.cc: Removed the #ifdef for AIX, because sigc::bind now works on AIX.
* Added new compiler tests to see whether extern C functions are put in theMurray Cumming2005-01-211-1/+13
| | | | | | | | | | | | | | | | | 2005-01-21 Murray Cumming <murrayc@murrayc.com> * configure.in, scripts/cxx.m4, glibmm/glibmmconfig.h.in: Added new compiler tests to see whether extern C functions are put in the global namespace, even when we use extern C inside a namespace declaration. The AIX xlC compiler does this, but allows us to redeclare the namespace inside the extern C block. * glib/glibmm/property.h: Use the new #ifdef GLIBMM_MUST_REDECLARE_NAMESPACES_INSIDE_EXTERNC and redeclare the namespace when necessary. * examples/thread/dispatcher.cc, dispatcher2.cc: Use sigc::bind<1> instead of just sigc::bind<> because the AIX xlC compiler needs the extra hint. However, the linker then fails, so the use of sigc::bind is ifdefed out for _AIX. See the comments in the code
* Regenerated with h2defs.py Added optionentry.[hg|ccg],Murray Cumming2004-09-261-1/+1
| | | | | | | | 2004-09-26 Murray Cumming <murrayc@murrayc.com> * glib/src/glib_functions.defs: Regenerated with h2defs.py * glib/src/: Added optionentry.[hg|ccg], optiongroup.[hg|ccg], optioncontext.[hg|ccg].
* Fixed a race condition on win32 that involved the combined use of auto_ptrCedric Gustin2004-09-131-10/+21
| | | | | | | | 2004-09-13 Cedric Gustin <cedric.gustin@swing.be> * examples/thread/dispatcher.cc: Fixed a race condition on win32 that involved the combined use of auto_ptr and multithreading (bug #109966).
* Explicitely join all threads. Hopefully that'll fix the crash on win32Daniel Elstner2004-06-141-2/+12
| | | | | * examples/thread/dispatcher.cc: Explicitely join all threads. Hopefully that'll fix the crash on win32 (see bug #109966).
* Remove unused parameter names to fix building with -Werror.Daniel Elstner2004-06-131-1/+1
| | | | | * examples/thread/dispatcher*.cc (main): Remove unused parameter names to fix building with -Werror.
* Revert last commit because it's silly. To make the code trulyDaniel Elstner2004-05-201-27/+7
| | | | | | | * examples/thread/dispatcher.cc: Revert last commit because it's silly. To make the code truly exception-safe it would be necessary to either join all threads or to notify them, which is way beyond the scope of this example.
* Set a good example and be paranoid about possible memory leaks due toDaniel Elstner2004-05-201-7/+27
| | | | | * examples/thread/dispatcher.cc: Set a good example and be paranoid about possible memory leaks due to exeptions.
* Code cleanup. Most importantly, get rid of the locking around std::coutDaniel Elstner2004-05-201-50/+51
| | | | | | * examples/thread/dispatcher.cc: Code cleanup. Most importantly, get rid of the locking around std::cout since it obfuscates the purpose of using Glib::Dispatcher.
* glibmm now uses libsigc++ 2 instead of libsigc++ 1.2. See bug #125061 forMurray Cumming2004-02-101-7/+7
| | | | | | | 2004-02-10 Murray Cumming <murrayc@usa.net> * glibmm now uses libsigc++ 2 instead of libsigc++ 1.2. See bug #125061 for more details. We must update CHANGES later.
* minor example code cleanupMurray Cumming2003-10-181-4/+7
|
* fixed to cast out all gktmm code, now they only need glimm. AddedJ. Abelardo Gutierrez2003-10-171-76/+56
| | | | | | | | | | 2003-10-02 J. Abelardo Gutierrez <jabelardo@cantv.net> * examples/threads/dispatcher.cc examples/threads/dispatcher2.cc: fixed to cast out all gktmm code, now they only need glimm. * configure.in: Added examples/threads because they don't use gtkmm anymore. Now all examples/threads compiles and run just fine.
* Initial revisionMurray Cumming2003-01-071-0/+192