File tree 3 files changed +10
-10
lines changed
regression/cbmc-sequentialization 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ void *worker(void *arguments)
12
12
for (int i = 0 ; i < 100 ; ++ i )
13
13
{
14
14
int shared_count_copy = shared_count ;
15
- // The following call to yield is here in order to cause a thread swap
16
- // during concrete execution in order to demonstrate unsoundness.
15
+ // The following call to yield is here in order to increase the chance of
16
+ // thread swaps during concrete execution in order to show unsoundness.
17
17
sched_yield ();
18
18
++ shared_count_copy ;
19
19
shared_count = shared_count_copy ;
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ void *worker(void *arguments)
15
15
const int lock_error = pthread_mutex_lock (& mutex );
16
16
assert (!lock_error );
17
17
int shared_count_copy = shared_count ;
18
- // The following call to yield is here in order to cause a thread swap
19
- // during concrete execution in order to demonstrate unsoundness.
18
+ // The following call to yield is here in order to increase the chance of
19
+ // thread swaps during concrete execution in order to show unsoundness.
20
20
sched_yield ();
21
21
++ shared_count_copy ;
22
22
shared_count = shared_count_copy ;
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ void set_state1(struct sharedt *shared)
19
19
{
20
20
shared -> a = 1 ;
21
21
shared -> b = 2 ;
22
- // The following call to yield causes a thread switch during concrete
23
- // execution in order to demonstrate unsoundness without locks .
22
+ // The following call to yield is here in order to increase the chance of
23
+ // thread swaps during concrete execution in order to show unsoundness.
24
24
sched_yield ();
25
25
shared -> c = 3 ;
26
26
}
@@ -29,8 +29,8 @@ void set_state2(struct sharedt *shared)
29
29
{
30
30
shared -> a = 4 ;
31
31
shared -> b = 5 ;
32
- // The following call to yield causes a thread switch during concrete
33
- // execution in order to demonstrate unsoundness without locks .
32
+ // The following call to yield is here in order to increase the chance of
33
+ // thread swaps during concrete execution in order to show unsoundness.
34
34
sched_yield ();
35
35
shared -> c = 6 ;
36
36
}
@@ -81,8 +81,8 @@ void *checker(void *arguments)
81
81
assert (!lock_error );
82
82
#endif
83
83
const bool is_state1 = shared -> a == 1 && shared -> b == 2 && shared -> c == 3 ;
84
- // The following call to yield causes a thread switch during concrete
85
- // execution in order to demonstrate unsoundness without locks .
84
+ // The following call to yield is here in order to increase the chance of
85
+ // thread swaps during concrete execution in order to show unsoundness.
86
86
sched_yield ();
87
87
const bool is_state2 = shared -> a == 4 && shared -> b == 5 && shared -> c == 6 ;
88
88
assert (is_state1 != is_state2 );
You can’t perform that action at this time.
0 commit comments