Apple interview question

Write a linked list insert method. Thread-safe and without using locks. (Tip: an atomic compare&swap function is available)