X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FSMP.h;h=d985576cb4780a52bfc6edb99db1abbc8e8f06de;hb=b5f43414d0329b56abaaeb5e9e4708000e93670c;hp=5974c962add936413d76506066940fe06cf46224;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/includes/SMP.h b/includes/SMP.h index 5974c96..d985576 100644 --- a/includes/SMP.h +++ b/includes/SMP.h @@ -155,6 +155,21 @@ xchg(StgPtr p, StgWord w) return old; } +INLINE_HEADER StgInfoTable * +lockClosure(StgClosure *p) +{ return (StgInfoTable *)p->header.info; } + +INLINE_HEADER void +unlockClosure(StgClosure *p STG_UNUSED, StgInfoTable *info STG_UNUSED) +{ /* nothing */ } + #endif /* !THREADED_RTS */ +// Handy specialised versions of lockClosure()/unlockClosure() +INLINE_HEADER void lockTSO(StgTSO *tso) +{ lockClosure((StgClosure *)tso); } + +INLINE_HEADER void unlockTSO(StgTSO *tso) +{ unlockClosure((StgClosure*)tso, (StgInfoTable*)&stg_TSO_info); } + #endif /* SMP_H */