MCPcopy Create free account
hub / github.com/apache/thrift / generateSeqId

Method generateSeqId

lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.cpp:176–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176int32_t TConcurrentClientSyncInfo::generateSeqId()
177{
178 Guard seqidGuard(seqidMutex_);
179 if(stop_)
180 throwDeadConnection_();
181
182 if(!seqidToMonitorMap_.empty())
183 if(nextseqid_ == seqidToMonitorMap_.begin()->first)
184 throw apache::thrift::TApplicationException(
185 TApplicationException::BAD_SEQUENCE_ID,
186 "about to repeat a seqid");
187 int32_t newSeqId = nextseqid_;
188 if (nextseqid_ == (std::numeric_limits<int32_t>::max)())
189 nextseqid_ = (std::numeric_limits<int32_t>::min)();
190 else
191 ++nextseqid_;
192 seqidToMonitorMap_[newSeqId] = newMonitor_(seqidGuard);
193 return newSeqId;
194}
195
196TConcurrentRecvSentry::TConcurrentRecvSentry(TConcurrentClientSyncInfo *sync, int32_t seqid) :
197 sync_(*sync),

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected