@@ -146,11 +146,20 @@ static void do_usrsock_blocking_socket_thread(FAR void *param)
146146 TEST_ASSERT_TRUE (test_hang );
147147 TEST_ASSERT_TRUE (test_abort );
148148
149+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
150+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
151+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
152+ #endif
153+
149154 /* Allow main thread to hang usrsock daemon at this point. */
150155
151156 sem_post (& tid_startsem );
152157 sem_wait (& tid_releasesem );
153158
159+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
160+ pthread_testcancel ();
161+ #endif
162+
154163 /* Attempt hanging open socket. */
155164
156165 sem_post (& tid_startsem );
@@ -176,6 +185,11 @@ static void do_usrsock_blocking_close_thread(FAR void *param)
176185 TEST_ASSERT_TRUE (test_hang );
177186 TEST_ASSERT_TRUE (test_abort );
178187
188+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
189+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
190+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
191+ #endif
192+
179193 /* Open socket. */
180194
181195 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -190,6 +204,10 @@ static void do_usrsock_blocking_close_thread(FAR void *param)
190204 sem_post (& tid_startsem );
191205 sem_wait (& tid_releasesem );
192206
207+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
208+ pthread_testcancel ();
209+ #endif
210+
193211 /* Attempt hanging close socket. */
194212
195213 sem_post (& tid_startsem );
@@ -214,6 +232,11 @@ static void do_usrsock_blocking_connect_thread(FAR void *param)
214232
215233 TEST_ASSERT_TRUE (test_hang || !test_hang );
216234
235+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
236+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
237+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
238+ #endif
239+
217240 /* Open socket. */
218241
219242 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -228,6 +251,10 @@ static void do_usrsock_blocking_connect_thread(FAR void *param)
228251 sem_post (& tid_startsem );
229252 sem_wait (& tid_releasesem );
230253
254+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
255+ pthread_testcancel ();
256+ #endif
257+
231258 /* Attempt blocking connect. */
232259
233260 sem_post (& tid_startsem );
@@ -257,6 +284,11 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void *param)
257284 bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT );
258285 bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING );
259286
287+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
288+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
289+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
290+ #endif
291+
260292 /* Open socket. */
261293
262294 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -274,6 +306,10 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void *param)
274306 sem_post (& tid_startsem );
275307 sem_wait (& tid_releasesem );
276308
309+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
310+ pthread_testcancel ();
311+ #endif
312+
277313 /* Attempt hanging setsockopt. */
278314
279315 sem_post (& tid_startsem );
@@ -304,6 +340,11 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void *param)
304340 bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT );
305341 bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING );
306342
343+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
344+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
345+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
346+ #endif
347+
307348 /* Open socket. */
308349
309350 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -321,6 +362,10 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void *param)
321362 sem_post (& tid_startsem );
322363 sem_wait (& tid_releasesem );
323364
365+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
366+ pthread_testcancel ();
367+ #endif
368+
324369 /* Attempt hanging getsockopt. */
325370
326371 sem_post (& tid_startsem );
@@ -352,6 +397,11 @@ static void do_usrsock_blocking_send_thread(FAR void *param)
352397
353398 TEST_ASSERT_TRUE (test_hang || !test_hang );
354399
400+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
401+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
402+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
403+ #endif
404+
355405 /* Open socket. */
356406
357407 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -372,6 +422,10 @@ static void do_usrsock_blocking_send_thread(FAR void *param)
372422 sem_post (& tid_startsem );
373423 sem_wait (& tid_releasesem );
374424
425+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
426+ pthread_testcancel ();
427+ #endif
428+
375429 /* Attempt blocking send. */
376430
377431 sem_post (& tid_startsem );
@@ -401,6 +455,11 @@ static void do_usrsock_blocking_recv_thread(FAR void *param)
401455
402456 TEST_ASSERT_TRUE (test_hang || !test_hang );
403457
458+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
459+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
460+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
461+ #endif
462+
404463 /* Open socket. */
405464
406465 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -421,6 +480,10 @@ static void do_usrsock_blocking_recv_thread(FAR void *param)
421480 sem_post (& tid_startsem );
422481 sem_wait (& tid_releasesem );
423482
483+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
484+ pthread_testcancel ();
485+ #endif
486+
424487 /* Attempt blocking recv. */
425488
426489 sem_post (& tid_startsem );
@@ -454,6 +517,11 @@ static void do_usrsock_blocking_poll_thread(FAR void *param)
454517 TEST_ASSERT_TRUE (test_abort );
455518 TEST_ASSERT_TRUE (test_hang || !test_hang );
456519
520+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
521+ pthread_setcancelstate (PTHREAD_CANCEL_ENABLE , NULL );
522+ pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED , NULL );
523+ #endif
524+
457525 /* Open socket. */
458526
459527 test_sd [tidx ] = socket (AF_INET , SOCK_STREAM , 0 );
@@ -474,6 +542,10 @@ static void do_usrsock_blocking_poll_thread(FAR void *param)
474542 sem_post (& tid_startsem );
475543 sem_wait (& tid_releasesem );
476544
545+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
546+ pthread_testcancel ();
547+ #endif
548+
477549 /* Attempt poll. */
478550
479551 pfd .fd = test_sd [tidx ];
@@ -560,8 +632,11 @@ static void do_wake_test(enum e_test_type type, int flags)
560632
561633 for (tidx = 0 ; tidx < nthreads ; tidx ++ )
562634 {
635+ #ifdef CONFIG_DISABLE_ALL_SIGNALS
636+ pthread_cancel (tid [tidx ]);
637+ #else
563638 pthread_kill (tid [tidx ], SIGUSR1 );
564-
639+ #endif
565640 /* Wait threads to complete work. */
566641
567642 ret = pthread_join (tid [tidx ], NULL );
0 commit comments