harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject [drlvm][threading] Infinite loop in atomic16_inc/atomic16_dec?
Date Thu, 19 Oct 2006 14:03:06 GMT

Today, I had several hangs of cunit tests. It turned out to be
infinite cycling in
while loop of atomic16_inc/atomic16_dec (see

Here is a snip of assembler code produced by msvc for atomic16_dec:

call        port_atomic_cas16 (10004A90h)
add         esp,0Ch
movzx       edx,ax <-----------------------------zero extention
movsx       eax,word ptr [old_value] <----sign extention
cmp         edx,eax
je          atomic16_inc+45h (10004A15h)

The problem can be easily fixed by changing int16 to unit16 in
atomic16_dec. Do you think this is accaptable way to fix the problem.

BTW, could somebody explain why 16-bit atomic operation is used for
32-bit value?


Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message