1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
--- cpp.orig/src/IceUtil/CtrlCHandler.cpp 2011-06-15 21:43:59.000000000 +0200
+++ cpp/src/IceUtil/CtrlCHandler.cpp 2012-03-04 20:14:53.000000000 +0100
@@ -219,29 +219,41 @@
sigaddset(&ctrlCLikeSignals, SIGHUP);
sigaddset(&ctrlCLikeSignals, SIGINT);
sigaddset(&ctrlCLikeSignals, SIGTERM);
- int rc = pthread_sigmask(SIG_BLOCK, &ctrlCLikeSignals, 0);
+#ifndef NDEBUG
+ int rc =
+#endif
+ pthread_sigmask(SIG_BLOCK, &ctrlCLikeSignals, 0);
assert(rc == 0);
// Joinable thread
- rc = pthread_create(&_tid, 0, sigwaitThread, 0);
+#ifndef NDEBUG
+ rc =
+#endif
+ pthread_create(&_tid, 0, sigwaitThread, 0);
assert(rc == 0);
}
}
CtrlCHandler::~CtrlCHandler()
{
- int rc = pthread_cancel(_tid);
+#ifndef NDEBUG
+ int rc =
+#endif
+ pthread_cancel(_tid);
assert(rc == 0);
#if defined(__APPLE__)
//
// WORKAROUND: sigwait isn't a cancellation point on MacOS X, see
// comment in sigwaitThread
//
- rc = pthread_kill(_tid, SIGTERM);
+ pthread_kill(_tid, SIGTERM);
//assert(rc == 0); For some reaosns, this assert is sometime triggered
#endif
void* status = 0;
- rc = pthread_join(_tid, &status);
+#ifndef NDEBUG
+ rc =
+#endif
+ pthread_join(_tid, &status);
assert(rc == 0);
#if !defined(__APPLE__)
assert(status == PTHREAD_CANCELED);
|