Fix -Wsign-compare
[folly.git] / folly / experimental / io / AsyncIO.h
index 6b6293261b95e261f7f7743c09124f71a8a41c0c..bd00d19640a28897598f2adcff10ead58f7fd3c5 100644 (file)
@@ -168,6 +168,12 @@ class AsyncIO : private boost::noncopyable {
    */
   size_t capacity() const { return capacity_; }
 
+  /**
+   * Return the accumulative number of submitted I/O, since this object
+   * has been created.
+   */
+  size_t totalSubmits() const { return submitted_; }
+
   /**
    * If POLLABLE, return a file descriptor that can be passed to poll / epoll
    * and will become readable when any async IO operations have completed.
@@ -197,8 +203,9 @@ class AsyncIO : private boost::noncopyable {
   std::atomic<bool> ctxSet_;
   std::mutex initMutex_;
 
-  std::atomic<ssize_t> pending_;
-  const ssize_t capacity_;
+  std::atomic<size_t> pending_;
+  std::atomic<size_t> submitted_;
+  const size_t capacity_;
   int pollFd_;
   std::vector<Op*> completed_;
 };
@@ -246,4 +253,3 @@ class AsyncIOQueue {
 }  // namespace folly
 
 #endif /* FOLLY_IO_ASYNCIO_H_ */
-