Commit Graph

13 Commits

Author SHA1 Message Date
Michael Meeks
c3a6a57fc2 re-base on ALv2 code. 2012-06-13 14:18:29 +01:00
Stephan Bergmann
2fa2660b55 Better fix for ThreadPool/ORequestThread life cycle
This is a follow up to d015384e1d "Fixed
ThreadPool (and dependent ORequestThread) life cycle" that still had some
problems:

* First, if Bridge::terminate was first entered from the reader or writer
thread, it would not join on that thread, so that thread could still be running
during exit.

That has been addressed by giving Bridge::dispose new semantics:  It waits until
both Bridge::terminate has completed (even if that was called from a different
thread) and all spawned threads (reader, writer, ORequestThread workers) have
been joined.  (This implies that Bridge::dispose must not be called from such a
thread, to avoid deadlock.)

* Second, if Bridge::terminate was first entered from an ORequestThread, the
call to uno_threadpool_dispose(0) to join on all such worker threads could
deadlock.

That has been addressed by making the last call to uno_threadpool_destroy wait
to join on all worker threads, and by calling uno_threadpool_destroy only from
the final Bridge::terminate (from Bridge::dispose), to avoid deadlock.  (The
special semantics of uno_threadpool_dispose(0) are no longer needed and have
been removed, as they conflicted with the fix for the third problem below.)

* Third, once uno_threadpool_destroy had called uno_threadpool_dispose(0), the
ThreadAdmin singleton had been disposed, so no new remote bridges could
successfully be created afterwards.

That has been addressed by making ThreadAdmin a member of ThreadPool, and making
(only) those uno_ThreadPool handles with overlapping life spans share one
ThreadPool instance (which thus is no longer a singleton, either).
Additionally, ORequestThread has been made more robust (in the style of
salhelper::Thread) to avoid races.

Change-Id: I2cbd1b3f9aecc1bf4649e482d2c22b33b471788f
2012-05-23 10:10:51 +02:00
Matúš Kukan
d899f976ee cppu: add visibility symbols 2011-12-19 10:14:52 +01:00
Caolán McNamara
da5cef0ab4 add modelines to .h and .c files as well 2010-10-27 16:04:46 +01:00
Jens-Heiner Rechtien
7c80db2eb3 changefileheader2: #i109125#: change source file copyright notice from Sun Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision) 2010-02-12 15:01:35 +01:00
Rüdiger Timm
44938898a2 INTEGRATION: CWS changefileheader (1.7.132); FILE MERGED
2008/03/31 07:23:18 rt 1.7.132.1: #i87441# Change license header to LPGL v3.
2008-04-11 09:25:29 +00:00
Rüdiger Timm
b2d307d111 INTEGRATION: CWS ooo19126 (1.6.174); FILE MERGED
2005/09/05 13:54:19 rt 1.6.174.1: #i54170# Change license header: remove SISSL
2005-09-08 07:42:34 +00:00
Jörg Budischewski
5ef4834323 #88337# documentation reviewed 2001-10-29 11:16:42 +00:00
Jörg Budischewski
cb137b6a14 incompatible change of the uno threadpool 2001-05-08 14:55:56 +00:00
Daniel Boelzle
d17143e649 no use of SAL_DLLEXPORT anymore, using def file 2001-03-28 09:50:37 +00:00
Daniel Boelzle
fee2a34fc7 revised function throw () clauses 2001-03-09 11:10:57 +00:00
Daniel Boelzle
8c3c9f8b91 added throw () clauses 2000-12-21 13:35:28 +00:00
Jens-Heiner Rechtien
b525a3115f initial import 2000-09-18 14:29:57 +00:00