Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

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