Changeset 9b67f170 in rtems


Ignore:
Timestamp:
08/13/96 15:36:28 (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b2e8026
Parents:
fc960ab
Message:

corrected problem in which sigtimedwait() was being invoked with
the wrong mask.

removed code which was commented out. This code was in another test.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/psxtests/psx03/init.c

    rfc960ab r9b67f170  
    147147  assert( !status );
    148148
    149   /* signal handler is still installed, mask is still set for SIGUSR1 */
     149  /* signal handler is still installed, waitset is still set for SIGUSR1 */
    150150 
    151151  /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */
     
    161161
    162162  puts( "Init: waiting on any signal for 3 seconds." );
    163   signo = sigtimedwait( &mask, &siginfo, &timeout );
    164   printf( "Init: correctly received SIGUSR1 - %d\n", siginfo.si_signo );
     163  signo = sigtimedwait( &waitset, &siginfo, &timeout );
     164  printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 );
    165165  assert( signo == SIGUSR1 );
    166166  assert( siginfo.si_signo == SIGUSR1 );
     
    168168  assert( siginfo.si_value.sival_int != -1 );   /* rtems does always set this */
    169169 
    170 
    171 /*
    172   status = sigemptyset( &mask );
    173   assert( !status );
    174 
    175   status = sigaddset( &mask, SIGUSR1 );
    176   assert( !status );
    177 
    178   printf( "Init: Block SIGUSR1\n" );
    179   status = sigprocmask( SIG_BLOCK, &mask, NULL );
    180   assert( !status );
    181 
    182   status = sigpending( &pending_set );
    183   assert( !status );
    184   printf( "Init: Signals pending 0x%08x\n", pending_set );
    185  
    186   printf( "Init: send SIGUSR1 to self\n" );
    187   status = pthread_kill( Init_id, SIGUSR1 );
    188   assert( !status );
    189 
    190   status = sigpending( &pending_set );
    191   assert( !status );
    192   printf( "Init: Signals pending 0x%08x\n", pending_set );
    193  
    194   printf( "Init: Unblock SIGUSR1\n" );
    195   status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
    196   assert( !status );
    197 
    198 */
    199 
    200   /*
    201    *  Loop for 5 seconds seeing how many signals we catch
    202    */
    203 
    204 /*
    205   tr.tv_sec = 5;
    206   tr.tv_nsec = 0;
    207  
    208   do {
    209     tv = tr;
    210 
    211     Signal_occurred = 0;
    212 
    213     status = nanosleep ( &tv, &tr );
    214     assert( !status );
    215 
    216     printf(
    217       "Init: signal was %sprocessed with %d:%d time remaining\n",
    218       (Signal_occurred) ? "" : "not ",
    219       (int) tr.tv_sec,
    220       (int) tr.tv_nsec
    221    );
    222 
    223   } while ( tr.tv_sec || tr.tv_nsec );
    224 
    225 */
    226 
    227170  /* exit this thread */
    228171
  • testsuites/psxtests/psx03/init.c

    rfc960ab r9b67f170  
    147147  assert( !status );
    148148
    149   /* signal handler is still installed, mask is still set for SIGUSR1 */
     149  /* signal handler is still installed, waitset is still set for SIGUSR1 */
    150150 
    151151  /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */
     
    161161
    162162  puts( "Init: waiting on any signal for 3 seconds." );
    163   signo = sigtimedwait( &mask, &siginfo, &timeout );
    164   printf( "Init: correctly received SIGUSR1 - %d\n", siginfo.si_signo );
     163  signo = sigtimedwait( &waitset, &siginfo, &timeout );
     164  printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 );
    165165  assert( signo == SIGUSR1 );
    166166  assert( siginfo.si_signo == SIGUSR1 );
     
    168168  assert( siginfo.si_value.sival_int != -1 );   /* rtems does always set this */
    169169 
    170 
    171 /*
    172   status = sigemptyset( &mask );
    173   assert( !status );
    174 
    175   status = sigaddset( &mask, SIGUSR1 );
    176   assert( !status );
    177 
    178   printf( "Init: Block SIGUSR1\n" );
    179   status = sigprocmask( SIG_BLOCK, &mask, NULL );
    180   assert( !status );
    181 
    182   status = sigpending( &pending_set );
    183   assert( !status );
    184   printf( "Init: Signals pending 0x%08x\n", pending_set );
    185  
    186   printf( "Init: send SIGUSR1 to self\n" );
    187   status = pthread_kill( Init_id, SIGUSR1 );
    188   assert( !status );
    189 
    190   status = sigpending( &pending_set );
    191   assert( !status );
    192   printf( "Init: Signals pending 0x%08x\n", pending_set );
    193  
    194   printf( "Init: Unblock SIGUSR1\n" );
    195   status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
    196   assert( !status );
    197 
    198 */
    199 
    200   /*
    201    *  Loop for 5 seconds seeing how many signals we catch
    202    */
    203 
    204 /*
    205   tr.tv_sec = 5;
    206   tr.tv_nsec = 0;
    207  
    208   do {
    209     tv = tr;
    210 
    211     Signal_occurred = 0;
    212 
    213     status = nanosleep ( &tv, &tr );
    214     assert( !status );
    215 
    216     printf(
    217       "Init: signal was %sprocessed with %d:%d time remaining\n",
    218       (Signal_occurred) ? "" : "not ",
    219       (int) tr.tv_sec,
    220       (int) tr.tv_nsec
    221    );
    222 
    223   } while ( tr.tv_sec || tr.tv_nsec );
    224 
    225 */
    226 
    227170  /* exit this thread */
    228171
Note: See TracChangeset for help on using the changeset viewer.