9 MarkPool::MarkPool(int start, int end)
10 : start(start), end(end)
12 assert(start > 0 && start < 65536);
13 assert(end > 0 && end < 65536);
15 for (int i = start; i < end; ++i) {
19 pthread_mutex_init(&mutex, NULL);
22 int MarkPool::get_mark()
24 MutexLock lock(&mutex);
25 if (free_marks.empty()) {
26 log(WARNING, "Out of free marks in mark pool %d-%d, session will not be marked. "
27 "To fix, increase the pool size and HUP the server.",
31 int mark = free_marks.front();
36 void MarkPool::release_mark(int mark)
42 MutexLock lock(&mutex);
43 free_marks.push(mark);