blob: 3b9128986ae7c74c9c02d731a9574b5ab0ddac88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include <boost/thread.hpp>
#include "caffe/layer.hpp"
namespace caffe {
template <typename Dtype>
void Layer<Dtype>::InitMutex() {
forward_mutex_.reset(new boost::mutex());
}
template <typename Dtype>
void Layer<Dtype>::Lock() {
if (IsShared()) {
forward_mutex_->lock();
}
}
template <typename Dtype>
void Layer<Dtype>::Unlock() {
if (IsShared()) {
forward_mutex_->unlock();
}
}
INSTANTIATE_CLASS(Layer);
} // namespace caffe
|