]> git.stg.codes - stg.git/blob - projects/traffcounter/lock.cpp
Fix encoding hint in documentation
[stg.git] / projects / traffcounter / lock.cpp
1 #include <cerrno>
2
3 #include <pthread.h>
4
5 #include "lock.h"
6
7
8 SCOPED_LOCK::SCOPED_LOCK(pthread_mutex_t & mtx)
9     : mutex(mtx)
10 {
11 pthread_mutex_lock(&mutex);
12 }
13
14 SCOPED_LOCK::~SCOPED_LOCK()
15 {
16 pthread_mutex_unlock(&mutex);
17 }