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