summaryrefslogtreecommitdiff
path: root/compiler/cbits
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cbits')
-rw-r--r--compiler/cbits/genSym.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
index 4217e636e1..08d403d849 100644
--- a/compiler/cbits/genSym.c
+++ b/compiler/cbits/genSym.c
@@ -4,10 +4,14 @@
static HsInt GenSymCounter = 0;
HsInt genSym(void) {
+#if defined(THREADED_RTS)
if (n_capabilities == 1) {
return GenSymCounter++;
} else {
return atomic_inc((StgWord *)&GenSymCounter, 1);
}
+#else
+ return GenSymCounter++;
+#endif
}