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

Function MaskThreadSignals

gpcontrib/gpcloud/src/gpcloud.cpp:87–107  ·  view source on GitHub ↗

* Set up the thread signal mask, we don't want to run our signal handlers * in downloading and uploading threads. */

Source from the content-addressed store, hash-verified

85 * in downloading and uploading threads.
86 */
87void MaskThreadSignals() {
88 sigset_t sigs;
89
90 if (pthread_equal(main_tid, pthread_self())) {
91 S3ERROR("thread_mask is called from main thread!");
92 return;
93 }
94
95 sigemptyset(&sigs);
96
97 /* make our thread to ignore these signals (which should allow that they be
98 * delivered to the main thread) */
99 sigaddset(&sigs, SIGHUP);
100 sigaddset(&sigs, SIGINT);
101 sigaddset(&sigs, SIGTERM);
102 sigaddset(&sigs, SIGALRM);
103 sigaddset(&sigs, SIGUSR1);
104 sigaddset(&sigs, SIGUSR2);
105
106 pthread_sigmask(SIG_BLOCK, &sigs, NULL);
107}
108
109/*
110 * Detect data format

Callers 2

DownloadThreadFuncFunction · 0.70
UploadThreadFuncMethod · 0.70

Calls 1

pthread_selfFunction · 0.85

Tested by

no test coverage detected