git.stg.codes
/
stg.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fixed merge issues.
[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
}