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-2025, 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
21extern PGDLLIMPORT volatile sig_atomic_t CancelRequested;
22
23extern void SetCancelConn(PGconn *conn);
24extern void ResetCancelConn(void);
25
26/*
27 * A callback can be optionally set up to be called at cancellation
28 * time.
29 */
30extern void setup_cancel_handler(void (*query_cancel_callback) (void));
31
32#endif /* CANCEL_H */
#define PGDLLIMPORT
Definition: c.h:1277
void ResetCancelConn(void)
Definition: cancel.c:107
PGDLLIMPORT volatile sig_atomic_t CancelRequested
Definition: cancel.c:59
void SetCancelConn(PGconn *conn)
Definition: cancel.c:77
void setup_cancel_handler(void(*query_cancel_callback)(void))
Definition: cancel.c:183
PGconn * conn
Definition: streamutil.c:53