slowLockMutex / putHeavyLock

Edouard G. Parmelan egp at
Sun Dec 17 12:49:26 PST 2000

Maxim Kizub wrote:

> >>   I have sometimes assertion erros
> >> from putHeavyLock method in
> >>         assert(*lkp == LOCKINPROGRESS);
> >>
> >> So, the question is - how lkp is
> >> supposed to be protected in current thread
> >> from being modified from others threads?
> >>
> GB> Which COMPARE_AND_EXCHANGE macro does it use?
As it run under Windows, it should be _compareAndExchange from
config/i386/win32/win32-md.asm.  But _this_ is not SMP safe as GCC
inlined version.

You should use `lock' prefix with `cmpxchg' instruction near line 88 but
as I don't remember the correct syntax, I can't send you a diff.

Could you try that and send me the correct line ?
Edouard G. Parmelan

More information about the kaffe mailing list