lock.c-annot.html from CQual at Krugle
Show lock.c-annot.html syntax highlighted
<html>
<body bgcolor="white">
<pre>
typedef struct {
volatile unsigned int lock;
} spinlock_t;
void spin_lock(<font color=green>$unlocked</font> spinlock_t *lock) {
/* assembly code */
change_type(*lock, <font color=red>$locked</font> spinlock_t);
}
void spin_unlock(<font color=red>$locked</font> spinlock_t *lock) {
/* assembly code */
change_type(*lock, <font color=green>$unlocked</font> spinlock_t);
}
<font color=green>$unlocked spinlock_t</font> rtc_lock;
int main(void)
{
rtc_lock;
spin_lock(&rtc_lock);
rtc_lock;
spin_unlock(&rtc_lock);
rtc_lock;
}
</pre>
</body>
</html>
See more files for this project here