Ticket #2228: 0002-testsuites-psxtimer01-Adapt-to-posix-timer-signal-fo.patch

File 0002-testsuites-psxtimer01-Adapt-to-posix-timer-signal-fo.patch, 2.1 KB (added by Daniel Krüger, on Dec 17, 2014 at 12:44:23 PM)
  • testsuites/psxtests/psxtimer01/psxtimer.c

    From 2a7175600aaffd371a98653a5fd752bf9c726a99 Mon Sep 17 00:00:00 2001
    From: Daniel Krueger <daniel.krueger@systec-electronic.com>
    Date: Fri, 28 Nov 2014 10:57:04 +0000
    Subject: [PATCH 2/6] testsuites/psxtimer01: Adapt to posix timer signal
     forwarding change
    
    Timer signals are forwarded to all threads now, so we need distinct
    signals for the different threads.
    
    Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
    ---
     testsuites/psxtests/psxtimer01/psxtimer.c |    8 +++++---
     1 file changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/testsuites/psxtests/psxtimer01/psxtimer.c b/testsuites/psxtests/psxtimer01/psxtimer.c
    index 032e9f8..4cf5370 100644
    a b void *POSIX_Init ( 
    350350   /* mask signal */
    351351   sigemptyset (&set);
    352352   sigaddset (&set,SIGALRM);
     353   sigaddset (&set,SIGRTMIN);
     354   sigaddset (&set,SIGRTMIN+1);
    353355   pthread_sigmask (SIG_BLOCK,&set,NULL);
    354356
    355357   /* set mutex attributes */
    void *POSIX_Init ( 
    421423   params_b.period.tv_sec  = 2;         /* seconds */
    422424   params_b.period.tv_nsec = 000000000; /* nanoseconds */
    423425   params_b.count          = 10;
    424    params_b.signo = SIGALRM;
     426   params_b.signo = SIGRTMIN;
    425427   if (pthread_create (&tb, &attr, task_b, &params_b) != 0) {
    426428     perror ("Error in thread create for task b\n");
    427429   }
    void *POSIX_Init ( 
    437439   params_c.period.tv_sec  = 3;         /* seconds */
    438440   params_c.period.tv_nsec = 000000000; /* nanoseconds */
    439441   params_c.count          = 6;
    440    params_c.signo = SIGALRM;
     442   params_c.signo = SIGRTMIN+1;
    441443   if (pthread_create (&tc, &attr, task_c, &params_c) != 0) {
    442444     perror ("Error in thread create for task c\n");
    443445   }
    void *POSIX_Init ( 
    450452   params_c1.period.tv_sec  = 0;         /* seconds */
    451453   params_c1.period.tv_nsec = 500000000; /* nanoseconds */
    452454   params_c1.count          = 6;
    453    params_c1.signo = SIGALRM;
     455   params_c1.signo = SIGRTMIN+1;
    454456   if (pthread_create (&tc1, &attr, task_c, &params_c1) != 0) {
    455457     perror ("Error in thread create for task c1\n");
    456458   }