Critical section problem codes
Critical section problem codes
Code 1:
return NULL; // Return NULL as this thread function does not need to
return a value
int main() {
pthread_join(threads[i], NULL);
}.
Output:
Or
Code 2:
int main() {
Output: