📚 The CoCalc Library - books, templates and other resources
1/* Example code for Think OS 2 3Copyright 2015 Allen Downey 4License: Creative Commons Attribution-ShareAlike 3.0 5 6*/ 7 8#include <pthread.h> 9 10typedef struct { 11 pthread_mutex_t mutex[1]; 12} Mutex; 13 14Mutex *make_mutex (); 15void mutex_lock(Mutex *mutex); 16void mutex_unlock(Mutex *mutex); 17 18