@@ -16,6 +16,7 @@ static void give(flg_t *flg, unsigned bitfield, unsigned check)
1616 {
1717 flag = bitfield & - bitfield ;
1818 bitfield -= flag ;
19+ check |= flag ;
1920 flags = flg_give (flg , flag ); ASSERT (flags == check );
2021 }
2122}
@@ -25,7 +26,7 @@ static void proc3()
2526 unsigned flags ;
2627 int result ;
2728
28- result = flg_wait (flg3 , FLAG3 , flgAllNew );
29+ result = flg_wait (flg3 , FLAG3 , flgAll + flgNew );
2930 ASSERT_success (result );
3031 flags = flg_give (flg2 , FLAG2 ); ASSERT (flags == FLAG2 );
3132 tsk_stop ();
@@ -36,6 +37,7 @@ static void proc2()
3637 unsigned flags ;
3738 int result ;
3839 ASSERT_dead (tsk3 );
40+ flg_clear (flg2 , -1U ); ASSERT (flg2 -> flags == 0 );
3941 tsk_startFrom (tsk3 , proc3 ); ASSERT_ready (tsk3 );
4042 result = flg_wait (flg2 , FLAG2 , flgAll ); ASSERT_success (result );
4143 give (flg3 , FLAG3 , FLAG3 );
@@ -50,6 +52,7 @@ static void proc1()
5052 unsigned flags ;
5153 int result ;
5254 ASSERT_dead (tsk2 );
55+ flg_clear (flg1 , -1U ); ASSERT (flg1 -> flags == 0 );
5356 tsk_startFrom (tsk2 , proc2 ); ASSERT_ready (tsk2 );
5457 result = flg_wait (flg1 , FLAG1 , flgAll ); ASSERT_success (result );
5558 give (flg2 , FLAG2 , 0 );
@@ -63,6 +66,7 @@ static void proc0()
6366{
6467 int result ;
6568 ASSERT_dead (tsk1 );
69+ flg_clear (& flg0 , -1U ); ASSERT (flg0 .flags == 0 );
6670 tsk_startFrom (tsk1 , proc1 ); ASSERT_ready (tsk1 );
6771 result = flg_wait (& flg0 , FLAG0 , flgAll ); ASSERT_success (result );
6872 give (flg1 , FLAG1 , 0 );
0 commit comments