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
typedef pthread_mutex_t Mutex;
9
typedef pthread_cond_t Cond;
10
11
void perror_exit(char *s);
12
void *check_malloc(int size);
13
14
Mutex *make_mutex();
15
void mutex_lock(Mutex *mutex);
16
void mutex_unlock(Mutex *mutex);
17
18
Cond *make_cond();
19
void cond_wait(Cond *cond, Mutex *mutex);
20
void cond_signal(Cond *cond);
21
22