-#define LONGLOCK_NUM_THREADS 8
-
-// === MACROS ===
-struct sShortSpinlock {
- volatile int Lock;
- int IF;
-};
-/**
- * \brief Determine if a short spinlock is locked
- */
-static inline int IS_LOCKED(struct sShortSpinlock *Lock) {
- return !!Lock->Lock;
-}
-/**
- * \brief Acquire a Short Spinlock
- * \note Stops interrupts, so be careful
- */
-static inline void SHORTLOCK(struct sShortSpinlock *Lock) {
- int v = 1;
- __ASM__ ("pushf;\n\tpop %%eax" : "=a"(Lock->IF));
- Lock->IF &= 0x200;
- __ASM__ ("cli"); // Stop task switches
- // Wait for another CPU to release
- while(v)
- __ASM__("xchgl %%eax, (%%edi)":"=a"(v):"a"(1),"D"(&Lock->Lock));
-}