diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-31 13:03:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-01 15:35:10 +0100 |
commit | 9aad6692612fca11230fdcbcaef436d2d1e1c0b4 (patch) | |
tree | 999de0aa5131bc713b0b102a930ab6395e2426d3 /io/source/acceptor | |
parent | 1c33dd6d012f8e3011f5b9df396f004acbc102d0 (diff) |
this is overly static + double check lock for little gain
Diffstat (limited to 'io/source/acceptor')
-rw-r--r-- | io/source/acceptor/acceptor.cxx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx index ea3cb02d11dc..f68ffe07d634 100644 --- a/io/source/acceptor/acceptor.cxx +++ b/io/source/acceptor/acceptor.cxx @@ -301,18 +301,9 @@ namespace io_acceptor Sequence< OUString > acceptor_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME)); + return seqNames; } OUString OAcceptor::getImplementationName() throw() |