From: Hyotaek Shim Date: Tue, 25 May 2021 05:56:51 +0000 (+0900) Subject: Add namespace sensor for Autolock X-Git-Tag: submit/tizen/20210628.005317~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e96d6fee64f76b442329f9a8b7360ff4edcfb496;p=platform%2Fcore%2Fsystem%2Fsensord.git Add namespace sensor for Autolock Change-Id: Ie5df4a9471cb2dfac519ce37cb195206fe7f5761 Signed-off-by: Hyotaek Shim --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index fa43b1a7..00000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.project -.cproject -.*.swp -nbproject -.vscode \ No newline at end of file diff --git a/src/shared/cbase_lock.cpp b/src/shared/cbase_lock.cpp index a7d75869..6c394973 100644 --- a/src/shared/cbase_lock.cpp +++ b/src/shared/cbase_lock.cpp @@ -24,6 +24,8 @@ #include #include +using namespace sensor; + cbase_lock::cbase_lock() { m_history_mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/shared/cbase_lock.h b/src/shared/cbase_lock.h index 2de5c7e2..5c76040b 100644 --- a/src/shared/cbase_lock.h +++ b/src/shared/cbase_lock.h @@ -22,6 +22,8 @@ #include +namespace sensor { + enum lock_type { LOCK_TYPE_MUTEX, LOCK_TYPE_READ, @@ -83,5 +85,6 @@ public: Autolock(cbase_lock &m, lock_type type); ~Autolock(); }; +} #endif /* _CBASE_LOCK_H_ */ diff --git a/src/shared/channel.cpp b/src/shared/channel.cpp index 22b0eaaa..10ed266b 100644 --- a/src/shared/channel.cpp +++ b/src/shared/channel.cpp @@ -30,6 +30,7 @@ #define SYSTEMD_SOCK_BUF_SIZE (128*1024) using namespace ipc; +using namespace sensor; class send_event_handler : public event_handler { diff --git a/src/shared/channel.h b/src/shared/channel.h index bc8444f3..5af06da6 100644 --- a/src/shared/channel.h +++ b/src/shared/channel.h @@ -74,7 +74,7 @@ private: std::vector m_pending_event_id; std::atomic m_connected; - cmutex m_cmutex; + sensor::cmutex m_cmutex; }; } diff --git a/src/shared/cmutex.cpp b/src/shared/cmutex.cpp index 6245b6e7..958835cb 100644 --- a/src/shared/cmutex.cpp +++ b/src/shared/cmutex.cpp @@ -20,6 +20,8 @@ #include #include +using namespace sensor; + cmutex::cmutex() { pthread_mutexattr_t mutex_attr; diff --git a/src/shared/cmutex.h b/src/shared/cmutex.h index 94aa2b68..343a260e 100644 --- a/src/shared/cmutex.h +++ b/src/shared/cmutex.h @@ -21,6 +21,7 @@ #define _CMUTEX_H_ #include "cbase_lock.h" +namespace sensor { class cmutex : public cbase_lock { public: @@ -39,4 +40,5 @@ private: pthread_mutex_t m_mutex; }; +} #endif /* _CMUTEX_H_ */ diff --git a/src/shared/event_loop.cpp b/src/shared/event_loop.cpp index a49a2e44..e0e97994 100644 --- a/src/shared/event_loop.cpp +++ b/src/shared/event_loop.cpp @@ -33,6 +33,7 @@ #define BAD_HANDLE 0 using namespace ipc; +using namespace sensor; static gboolean g_io_handler(GIOChannel *ch, GIOCondition condition, gpointer data) { diff --git a/src/shared/event_loop.h b/src/shared/event_loop.h index 405f628c..40fcb2ec 100644 --- a/src/shared/event_loop.h +++ b/src/shared/event_loop.h @@ -98,7 +98,7 @@ private: std::map m_handlers; int m_term_fd; - cmutex m_cmutex; + sensor::cmutex m_cmutex; }; }