linux-sysprog · beginner · ~15 min
Name the common concurrency bugs.
Implement int is_concurrency_bug(const char *desc) returning 1 for "unguarded-shared-write", "double-unlock", and "join-after-detach", and 0 for "thread-local-counter".
#include <string.h>
int is_concurrency_bug(const char *desc) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.