MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / init

Method init

core/cube/cube-server/src/recycle.cpp:37–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35Recycle::~Recycle() {}
36
37int Recycle::init() {
38 // init mutex lock;
39 if (pthread_mutex_init(&_recycle_mutex, NULL) != 0) {
40 LOG(ERROR) << "init recycle lock failed";
41 return -1;
42 }
43
44 _running = true;
45
46 // init thread;
47 if (pthread_create(&_recycle_thread,
48 NULL,
49 Recycle::recycle_func,
50 reinterpret_cast<void*>(this)) != 0) {
51 LOG(ERROR) << "init recycle thread failed";
52 return -1;
53 }
54 return 0;
55}
56
57int Recycle::destroy() {
58 _running = false;

Callers 1

runFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected