PostgreSQL Source Code  git master
cancel.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * Query cancellation support for frontend code
4  *
5  *
6  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/fe_utils/cancel.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef CANCEL_H
15 #define CANCEL_H
16 
17 #include <signal.h>
18 
19 #include "libpq-fe.h"
20 
21 extern volatile sig_atomic_t CancelRequested;
22 
23 extern void SetCancelConn(PGconn *conn);
24 extern void ResetCancelConn(void);
25 
26 /*
27  * A callback can be optionally set up to be called at cancellation
28  * time.
29  */
30 extern void setup_cancel_handler(void (*cancel_callback) (void));
31 
32 #endif /* CANCEL_H */
static void(* cancel_callback)(void)
Definition: cancel.c:61
volatile sig_atomic_t CancelRequested
Definition: cancel.c:52
void ResetCancelConn(void)
Definition: cancel.c:100
void setup_cancel_handler(void(*cancel_callback)(void))
Definition: cancel.c:179
PGconn * conn
Definition: streamutil.c:54
void SetCancelConn(PGconn *conn)
Definition: cancel.c:70