lock.c-orig.html from CQual at Krugle
Show lock.c-orig.html syntax highlighted
<html>
<body bgcolor="white">
<pre>
typedef struct {
volatile unsigned int lock;
} spinlock_t;
void spin_lock(spinlock_t *lock) {
/* assembly code */
}
void spin_unlock(spinlock_t *lock) {
/* assembly code */
}
spinlock_t 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