cancel.h 792 B

1234567891011121314151617181920212223242526272829303132
  1. /*-------------------------------------------------------------------------
  2. *
  3. * Query cancellation support for frontend code
  4. *
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. #ifndef CANCEL_H
  14. #define CANCEL_H
  15. #include <signal.h>
  16. #include "libpq-fe.h"
  17. extern PGDLLIMPORT volatile sig_atomic_t CancelRequested;
  18. extern void SetCancelConn(PGconn *conn);
  19. extern void ResetCancelConn(void);
  20. /*
  21. * A callback can be optionally set up to be called at cancellation
  22. * time.
  23. */
  24. extern void setup_cancel_handler(void (*cancel_callback) (void));
  25. #endif /* CANCEL_H */