Hi, I just wanted to let you know that _atomic_lock(), from _atomic_lock.c, as used by librthread should probably have a barrier instruction added to prevent the processor from reordering loads/stores around the atomic_lock.
For more information about barriers on ARM, see: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/CIHGHHIE.html For some examples, see sections 7.2.1 and 7.2.2 http://infocenter.arm.com/help/topic/com.arm.doc.genc007826/Barrier_Litmus_Tests_and_Cookbook_A08.pdf -Richard