Threads Cheat Sheet
- int pthread_create(pthread_t *tid, pthread_attr_t *attr, void *(*func)(void *), void *arg);
- int pthread_join(pthread_t tid, void **val);
- void pthread_exit(void *val);
- int pthread_cancel(pthread_t tid);
- pthread_t pthread_self(void);
- INITIALIZATION: pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; OR pthread_mutex_init(&mutex, NULL);
- int pthread_mutex_lock(pthread_mutex_t *mutex);
- int pthread_mutex_unlock(pthread_mutex_t *mutex);
- int pthread_mutex_destroy(pthread_mutex_t *mutex);