There's no reason to use std::mutex where we can use Osv's "mutex".
std::mutex basically wraps OSv's mutex by a Posix mutex and then C++'s
mutex implementation, adding both compile-time and run-time overheads -
which are not huge, but not zero either.

To use "mutex" we need to stop doing "using namespace std", because that
makes the name "mutex" ambiguous.

Signed-off-by: Nadav Har'El <n...@scylladb.com>
---
 fs/vfs/vfs_mount.cc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/vfs/vfs_mount.cc b/fs/vfs/vfs_mount.cc
index ef6f29e..9e241ad 100644
--- a/fs/vfs/vfs_mount.cc
+++ b/fs/vfs/vfs_mount.cc
@@ -53,17 +53,15 @@
 #include <memory>
 #include <list>
 
-using namespace std;
-
 /*
  * List for VFS mount points.
  */
-static list<mount*> mount_list;
+static std::list<mount*> mount_list;
 
 /*
  * Global lock to access mount point.
  */
-static std::mutex mount_lock;
+static mutex mount_lock;
 
 /*
  * Lookup file system.
@@ -452,11 +450,11 @@ mount_desc to_mount_desc(mount* m)
     return ret;
 }
 
-vector<mount_desc>
+std::vector<mount_desc>
 current_mounts()
 {
     WITH_LOCK(mount_lock) {
-        vector<mount_desc> ret;
+        std::vector<mount_desc> ret;
         for (auto&& mp : mount_list) {
             ret.push_back(to_mount_desc(mp));
         }
-- 
2.9.3

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to