Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 73285 invoked from network); 1 Aug 2006 22:03:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 22:03:01 -0000 Received: (qmail 52760 invoked by uid 500); 1 Aug 2006 22:03:01 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 52749 invoked by uid 500); 1 Aug 2006 22:03:01 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 52738 invoked by uid 99); 1 Aug 2006 22:03:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 15:03:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 15:02:59 -0700 Received: from qxvcexch01.ad.quovadx.com (qxvcexch01.ad.quovadx.com [192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.4) with ESMTP id k71M29Os017984 for ; Tue, 1 Aug 2006 22:02:09 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6B5B6.3659182C" Subject: SourcePro ed 3 - deadlock situation Date: Tue, 1 Aug 2006 16:02:42 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: exec util testing commands [patch] Thread-Index: Aca1khqp1fxtSmRgS0GIMLctmnv54AAJIGew From: "Ravi Inampudi" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C6B5B6.3659182C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, A customer ran into a deadlock situation using SourcePro ed 3 with = locale specific code. In locale.h and locale.cpp, it is mentioned in the = code that there was an attempt to fix a deadlock scenario. Source code = snippets appended below. However, SourcePro ed 9 locale API seem to have = been redesigned. Could it be assumed that this deadlock problem was = addressed at some point? How difficult is it to port these changes to = SourcePro ed 3? =20 Regards, Ravi =20 > = /ms/dev/3rd/RWSourcePro/3.1/src/rw_buildspace/source/stdlib/locale.cpp:5 > 55 >=20 > if (__imp && __imp !=3D _C_imp) { > // HACK: we might (should?) be locked here but locale > dtor > // locks again - this despicable hack prevents a > deadlock > locale __loc (__imp); > __loc._C_install_facet (__facet, __id); > __loc._C_imp =3D 0; // set to 0 to prevent dtor from > locking > --__imp->_C_ref_count; // decrement manually > } >=20 > /ms/dev/3rd/RWSourcePro/3.1/src/rw_buildspace/include/rw/_locale.h: = 170 > ~locale () { > // HACK: _C_imp should normally never be 0; internally, = though, > // it's set to 0 in locale::_C_make_facet to prevent a = deadlock > if (_C_imp && 0 =3D=3D _RWSTD_ATOMIC_PREDECREMENT > (_C_imp->_C_ref_count, > =20 > _C_imp->_C_mutex)) > delete _C_imp; > } >=20 > /ms/dev/3rd/RWSourcePro/3.1/src/rw_buildspace/include/rw/_locale.h: = 510 > // same as above but not guarded; called during initialization > // of the num_get<> and num_put<> facets (this is a hack) > inline const locale::facet& > locale::_C_unsafe_use_facet (const id &__id, bool __implicit, category > __cat, > __facet_maker_func __maker) const > { > _RWSTD_ASSERT (0 !=3D _C_imp); >=20 > const facet *__facet =3D _C_get_facet (__id); >=20 > if (!__facet) > __facet =3D _C_make_facet (__id, __implicit, __cat, __maker); >=20 > _RWSTD_ASSERT (__facet); >=20 > return *__facet; > } ------_=_NextPart_001_01C6B5B6.3659182C--