MCPcopy Create free account
hub / github.com/apache/cloudberry / SetCancelConn

Function SetCancelConn

src/fe_utils/cancel.c:76–99  ·  view source on GitHub ↗

* SetCancelConn * * Set cancelConn to point to the current database connection. */

Source from the content-addressed store, hash-verified

74 * Set cancelConn to point to the current database connection.
75 */
76void
77SetCancelConn(PGconn *conn)
78{
79 PGcancel *oldCancelConn;
80
81#ifdef WIN32
82 EnterCriticalSection(&cancelConnLock);
83#endif
84
85 /* Free the old one if we have one */
86 oldCancelConn = cancelConn;
87
88 /* be sure handle_sigint doesn't use pointer while freeing */
89 cancelConn = NULL;
90
91 if (oldCancelConn != NULL)
92 PQfreeCancel(oldCancelConn);
93
94 cancelConn = PQgetCancel(conn);
95
96#ifdef WIN32
97 LeaveCriticalSection(&cancelConnLock);
98#endif
99}
100
101/*
102 * ResetCancelConn

Callers 11

consumeQueryResultFunction · 0.85
wait_on_slotsFunction · 0.85
PSQLexecFunction · 0.85
PSQLexecWatchFunction · 0.85
ProcessResultFunction · 0.85
SendQueryFunction · 0.85
do_lo_exportFunction · 0.85
do_lo_importFunction · 0.85
do_lo_unlinkFunction · 0.85
runInitStepsFunction · 0.85

Calls 2

PQfreeCancelFunction · 0.85
PQgetCancelFunction · 0.85

Tested by

no test coverage detected