From 074a39c989c7d92aa52e1584c780dd49b22cbb57 Mon Sep 17 00:00:00 2001 From: Jaemin Ryu Date: Mon, 4 Jul 2016 15:35:01 +0900 Subject: [PATCH] Remove unsupported sources Change-Id: I269bd95f5103894f811e1167bcb5a1111aa0c903 Signed-off-by: Jaemin Ryu --- common/CMakeLists.txt | 1 - common/backtrace.cpp | 52 ------------------------------------ common/backtrace.h | 28 ------------------- common/object-latch.h | 74 --------------------------------------------------- 4 files changed, 155 deletions(-) delete mode 100644 common/backtrace.cpp delete mode 100644 common/backtrace.h delete mode 100644 common/object-latch.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 13d4eda..a727335 100755 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -22,7 +22,6 @@ SET (COMMON_SOURCES ${DPM_COMMON}/error.cpp ${DPM_COMMON}/eventfd.cpp ${DPM_COMMON}/mainloop.cpp ${DPM_COMMON}/filesystem.cpp - ${DPM_COMMON}/backtrace.cpp ${DPM_COMMON}/thread-pool.cpp ${DPM_COMMON}/rmi/socket.cpp ${DPM_COMMON}/rmi/client.cpp diff --git a/common/backtrace.cpp b/common/backtrace.cpp deleted file mode 100644 index f566ede..0000000 --- a/common/backtrace.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -#include -#include -#include -#include -#include - -#include "backtrace.h" -#include "error.h" -#include "exception.h" - -#define BACKTRACING_ENTRIES 128 - -namespace runtime { - -void backtrace(const std::string& filename) -{ - int fd, ret; - void *buffer[BACKTRACING_ENTRIES]; - - do { - fd = ::open(filename.c_str(), O_WRONLY | O_CREAT, 0777); - } while ((fd == -1) && (errno == EINTR)); - - if (fd == -1) { - throw runtime::Exception(runtime::GetSystemErrorMessage()); - } - - int nptrs = ::backtrace(buffer, BACKTRACING_ENTRIES); - ::backtrace_symbols_fd(buffer, nptrs, fd); - - do { - ret = ::close(fd); - } while ((ret == -1) && (errno == EINTR)); -} - -} // namespace runtime diff --git a/common/backtrace.h b/common/backtrace.h deleted file mode 100644 index bb4465b..0000000 --- a/common/backtrace.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - - #ifndef __RUNTIME_BACKTRACE_H__ - #define __RUNTIME_BACKTRACE_H__ - -#include - -namespace runtime { - -void backtrace(const std::string& filename); - -} // namespace runtime - - #endif //!__RUNTIME_BACKTRACE_H__ diff --git a/common/object-latch.h b/common/object-latch.h deleted file mode 100644 index e3dcbae..0000000 --- a/common/object-latch.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -#ifndef __RUNTIME_OBJECT_LATCH_H__ -#define __RUNTIME_OBJECT_LATCH_H__ - -#include -#include -#include - -template -class ObjectLatch { -public: - ObjectLatch() : - state(false) - { - } - - ObjectLatch(const ObjectLatch&) = delete; - ObjectLatch& operator=(const ObjectLatch&) = delete; - - void set(const DataType& val) - { - data = val; - state = true; - condition.notify_one(); - } - - void set(DataType&& val) - { - data = std::move(val); - state = true; - condition.notify_one(); - } - - DataType get() - { - return DataType(std::move(data)); - } - - bool isValid() const - { - return state == true; - } - - void wait() - { - std::unique_lock lock(stateLock); - condition.wait(lock, [this]{ - return isValid(); - }); - } - -private: - DataType data; - bool state; - std::mutex stateLock; - std::condition_variable condition; -}; - -#endif //__RUNTIME_OBJECT_LATCH_H__ -- 2.7.4