- (inst mov target 1)
- (inst xor eax-tn eax-tn)
- (inst lock)
- (inst cmpxchg (make-ea-for-symbol-value *tls-index-lock*) target)
- (inst jmp :ne get-tls-index-lock)
+ (let ((not-eax ,(if (eql 'eax reg) 'other 'target)))
+ (inst mov not-eax 1)
+ (inst xor eax-tn eax-tn)
+ (inst cmpxchg (make-ea-for-symbol-value *tls-index-lock*)
+ not-eax :lock)
+ (inst jmp :ne get-tls-index-lock))