X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FRtsAPI.h;h=5160046da804ab79449d98c72c6a8ea4b6a33e07;hb=d1c9e5aaf9f032ad9c4b123499bdd948c2fe9e47;hp=41f0fc026c502fc4697d25ea11a6eb53e9013b83;hpb=5a5acb3698aa4ffdd738c301fa722afe12a1f3de;p=ghc-hetmet.git diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index 41f0fc0..5160046 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -66,6 +66,15 @@ Capability *rts_lock (void); // releases the token acquired with rts_lock(). void rts_unlock (Capability *token); +// If you are in a context where you know you have a current capability but +// do not know what it is, then use this to get it. Basically this only +// applies to "unsafe" foreign calls (as unsafe foreign calls are made with +// the capability held). +// +// WARNING: There is *no* guarantee this returns anything sensible (eg NULL) +// when there is no current capability. +Capability *rts_unsafeGetMyCapability (void); + /* ---------------------------------------------------------------------------- Building Haskell objects from C datatypes. ------------------------------------------------------------------------- */