All pastes #52287 Raw Edit

kommerck

public text v1 · immutable
#52287 ·published 2006-04-29 22:48 UTC
rendered paste body
void* InterlockedExchangePointer(void** target, void* value)
//Based on TBCOOL's suggestion
//don't think it works as expected now
{
	__asm__ __volatile__ (
		"  lock\n"
		"  xchgl %1,%0\n"
		: "=a" (**target), "=b" (*value)
		: "a" (**target), "b" (*value)
		: "%ebx", "%eax", "memory" );
	return value;
}