summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-02-16 12:22:21 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-02-16 12:32:26 +0100
commitc240c73c34b50f4447107ccb0b0dbb21c1f28a74 (patch)
tree01ab18a8e761ed81217317ad44513a5f42a481aa /sal/rtl
parent15003612ae3a7fc5ca994548d9792349787c68d1 (diff)
Remove mis-optimization
Assume thread t1 creates OUString s, then spawns thread t2, then t2 acquires s, then t2 signals via a channel that does not necessarily involve memory synchronization (e.g., writes a byte into a pipe which t1 reads), then t1 releases s and can still see a refCount of 1 instead of 2. Change-Id: I31047a1a6cc8fccc401a87849f5c3cee3642d803
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/source/strtmpl.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index f5cbddd8e6f7..5f59795c0a34 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -1103,8 +1103,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
}
#endif
- if ( pThis->refCount == 1 ||
- !osl_atomic_decrement( &(pThis->refCount) ) )
+ if ( !osl_atomic_decrement( &(pThis->refCount) ) )
{
RTL_LOG_STRING_DELETE( pThis );
rtl_freeMemory( pThis );