Fix -Wsign-compare
[folly.git] / folly / experimental / io / AsyncIO.h
index b595a325f64ab6617b6678827d6cea0704ea9999..bd00d19640a28897598f2adcff10ead58f7fd3c5 100644 (file)
@@ -32,8 +32,8 @@
 
 #include <boost/noncopyable.hpp>
 
-#include "folly/Portability.h"
-#include "folly/Range.h"
+#include <folly/Portability.h>
+#include <folly/Range.h>
 
 namespace folly {
 
@@ -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_ */
-