summaryrefslogtreecommitdiffhomepage
path: root/plugins/fcgi/fcgiid.cpp
blob: 778cbc9ce26d3ddfefcb7eb7aa5d2a24a149986e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "fcgiid.h"
 
 // starting at 1
uint16_t FCGI_ID::getID()
{
 if (m_unused.empty()) {
  m_current_max++;
  return m_current_max;
 } else {
  uint16_t result{*m_unused.begin()};
  m_unused.erase(m_unused.begin());
  return result;
 }
}

void FCGI_ID::putID(uint16_t id)
{
 m_unused.insert(id);
}