0647aed362f7927d2b551a86a14d78c2372682f5
[IRC.git] / Robust / src / Runtime / STM / stmlock.c
1 #include "stmlock.h"
2 #include <stdio.h>
3
4
5 /*
6 int write_trylock(volatile unsigned int *lock) {
7   int retval=0;
8   __asm__ __volatile__("xchgl %0,%1"
9                : "=r"(retval)
10                : "m"(*__xg(lock)), "0"(retval)
11                : "memory");
12   return retval;
13 }
14
15
16 void write_unlock(volatile unsigned int *lock) {
17   __asm __volatile__("movl $1, %0" : "+m" (*lock)::"memory");
18 }
19 */