Skip to content

Instantly share code, notes, and snippets.

@egraldlo
Created June 8, 2017 01:00
Show Gist options
  • Save egraldlo/ff456b0fd25d38ac2124a451c82853c1 to your computer and use it in GitHub Desktop.
Save egraldlo/ff456b0fd25d38ac2124a451c82853c1 to your computer and use it in GitHub Desktop.
specific usage of xabort
unsigned status = 0;
while(true)
{
status = _xbegin();
if(status == _XBEGIN_STARTED)
{
//Transaction code
bool success = transaction_func();
if(success)
{
_xend();
break;
}
else
{
_xabort(0Xff);
continue;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment