Skip to content

Commit

Permalink
Modify example.c
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Oct 31, 2024
1 parent 60be1db commit c22203a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions adb_examples/debt-24-demo/paper-example/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ int f(ThreadAction action) {
case CACHE:
printf("Store in local cache!\n");
cache = 42;
break; // remove for flawed version
case PUBLISH:
printf("Publish work!\n");
global = 42;
}
}

void *t(void *arg) {
if (pthread_mutex_lock(&mutex)) {
if (pthread_mutex_trylock(&mutex)) {
f(CACHE);
} else {
f(PUBLISH);
Expand Down

0 comments on commit c22203a

Please sign in to comment.