rts: Add --internal-counters RTS flag and several counters
[ghc.git] / rts / Messages.h
1 /* ---------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2010
4 *
5 * Inter-Capability message passing
6 *
7 * --------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #include "BeginPrivate.h"
12
13 uint32_t messageBlackHole(Capability *cap, MessageBlackHole *msg);
14 StgTSO * blackHoleOwner (StgClosure *bh);
15
16 #if defined(THREADED_RTS)
17 void executeMessage (Capability *cap, Message *m);
18 void sendMessage (Capability *from_cap, Capability *to_cap, Message *msg);
19 #endif
20
21 #include "Capability.h"
22 #include "Updates.h" // for DEBUG_FILL_SLOP
23 #include "SMPClosureOps.h"
24
25 INLINE_HEADER void
26 doneWithMsgThrowTo (MessageThrowTo *m)
27 {
28 OVERWRITING_CLOSURE((StgClosure*)m);
29 unlockClosure((StgClosure*)m, &stg_MSG_NULL_info);
30 LDV_RECORD_CREATE(m);
31 }
32
33 #include "EndPrivate.h"
34
35 #if defined(THREADED_RTS) && defined(PROF_SPIN)
36 extern volatile StgWord64 whitehole_executeMessage_spin;
37 #endif