PerfCounters *logger;
int global_seq;
__u32 connect_seq, peer_global_seq;
- atomic64_t out_seq;
- atomic64_t ack_left, in_seq;
+ std::atomic<uint64_t> out_seq{0};
+ std::atomic<uint64_t> ack_left{0}, in_seq{0};
int state;
int state_after_send;
ConnectedSocket cs;
DispatchQueue *dispatch_queue;
+ // lockfree, only used in own thread
+ bufferlist outcoming_bl;
+ bool open_write = false;
+
std::mutex write_lock;
enum class WriteStatus {
NOWRITE,
CLOSED
};
std::atomic<WriteStatus> can_write;
- bool open_write;
- map<int, list<pair<bufferlist, Message*> > > out_q; // priority queue for outbound msgs
list<Message*> sent; // the first bufferlist need to inject seq
- bufferlist outcoming_bl;
+ map<int, list<pair<bufferlist, Message*> > > out_q; // priority queue for outbound msgs
bool keepalive;
std::mutex lock;