summaryrefslogtreecommitdiff
path: root/rts/TopHandler.h
blob: 1146eea71cf4ab711780a32637d8f4accac10d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2016
 *
 * Top-level handler support
 *
 * ---------------------------------------------------------------------------*/

#pragma once

#include <BeginPrivate.h>

#include <rts/Types.h>
#include <rts/storage/Closures.h>
#include <stg/Types.h>
#include <rts/Stable.h>

// Initialize the top handler subsystem
void initTopHandler(void);

// Exit the top handler subsystem
void exitTopHandler(void);

// Get the thread that handles ctrl-c, etc
// Returns NULL if there is no such thread
StgTSO *getTopHandlerThread(void);

#include <EndPrivate.h>

// Called from Haskell
void rts_setMainThread(StgWeak *ptr);