Fixed issue with Lock/UnlockStaticBuffer() on R5

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9286 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2004-10-11 23:33:01 +00:00
parent 9edda3ec6d
commit cbc9d62f52

View File

@ -4468,7 +4468,7 @@ void
BTextView::LockWidthBuffer()
{
CALLED();
if (atomic_add(&sWidthAtom, 1) > 0) {
if (atomic_add(&sWidthAtom, -1) <= 0) {
while (acquire_sem(sWidthSem) == B_INTERRUPTED)
;
}
@ -4481,6 +4481,6 @@ void
BTextView::UnlockWidthBuffer()
{
CALLED();
if (atomic_add(&sWidthAtom, -1) > 1)
if (atomic_add(&sWidthAtom, 1) < 0)
release_sem(sWidthSem);
}