Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0bb3634

Browse files
authored
Alternating threads
1 parent c8636d2 commit 0bb3634

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎print_seq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int even_print_one(const int start, const int end) {
4949
pthread_mutex_lock(&mtx);
5050

5151
// wait for cond to be singaled by using mtx and cond
52-
while (thread_run == 1) {
52+
while (thread_run == 2) {
5353
pthread_cond_wait(&cond, &mtx);
5454
}
5555
if (seq > end) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /