On Tue, Jun 10, 2008 at 4:10 PM, Helge Deller <deller@gmx.de> wrote:
For Qt it might work as I mentioned without copying atomic.h from glibc.
Qt uses ldcw() not directly. Instead it uses q_atomic_lock(), which then
utilizes q_ldcw().
Here is the code (from src/corelib/arch/parisc/qatomic_parisc.cpp):
void q_atomic_lock(int *lock)
{
// ldcw requires a 16-byte aligned address
volatile int *x = align16(lock);
while (q_ldcw(x) == 0)
;
}
So, the 16byte alignment is taken care of by align16().
My attempt was based on having a minimal patch against Qt.
How is align16() implemented? Is the "int *lock" actually a block of
more than 4 ints? If yes, then this will work, and it's similar to the
approach taken by linuxthreads.