projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix trac #3001: Biographical profiling segfaults
[ghc-hetmet.git]
/
includes
/
SMP.h
diff --git
a/includes/SMP.h
b/includes/SMP.h
index
5d74667
..
49bc336
100644
(file)
--- a/
includes/SMP.h
+++ b/
includes/SMP.h
@@
-218,6
+218,17
@@
xchg(StgPtr p, StgWord w)
return old;
}
+STATIC_INLINE StgWord
+cas(StgVolatilePtr p, StgWord o, StgWord n)
+{
+ StgWord result;
+ result = *p;
+ if (result == o) {
+ *p = n;
+ }
+ return result;
+}
+
#endif /* !THREADED_RTS */
#endif /* SMP_H */