We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff2b623 commit 15a9cb7Copy full SHA for 15a9cb7
1 file changed
api/smp
@@ -59,21 +59,21 @@ struct minimal_barrier_t
59
{
60
__sync_fetch_and_add(&val, 1);
61
}
62
-
+
63
void spin_wait(int max)
64
65
asm("mfence");
66
while (this->val < max) {
67
asm("pause; nop;");
68
69
70
71
void reset(int val)
72
73
asm volatile("mfence");
74
this->val = val;
75
76
77
private:
78
volatile int val = 0;
79
};
@@ -131,4 +131,11 @@ public:
131
// access a std::array of structs indexed by current CPU id
132
#define PER_CPU(x) (per_cpu_help<decltype(x)::value_type, x.size()>(x))
133
134
+#ifndef ARCH_X86
135
+typedef int spinlock_t;
136
+inline void lock(spinlock_t&) {}
137
+inline void unlock(spinlock_t&) {}
138
+#endif
139
140
#endif
141
0 commit comments