From 786eb5ae9c77970f25f662d57a83276d09c9a72d Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 30 Apr 2020 21:08:04 +0800 Subject: [C++] rename the Thread/Mutex to cxx_Thread/Mutex to avoid same name issue --- components/cplusplus/Semaphore.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 components/cplusplus/Semaphore.cpp (limited to 'components/cplusplus/Semaphore.cpp') diff --git a/components/cplusplus/Semaphore.cpp b/components/cplusplus/Semaphore.cpp deleted file mode 100644 index c977a27c1a..0000000000 --- a/components/cplusplus/Semaphore.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#include "Semaphore.h" - -using namespace rtthread; - -Semaphore::Semaphore(const char *name, int32_t count) -{ - rt_sem_init(&mID, name, count, RT_IPC_FLAG_FIFO); -} - -bool Semaphore::wait(int32_t millisec) -{ - rt_int32_t tick; - - if (millisec < 0) - tick = -1; - else - tick = rt_tick_from_millisecond(millisec); - - return rt_sem_take(&mID, tick) == RT_EOK; -} - -void Semaphore::release(void) -{ - rt_sem_release(&mID); -} - -Semaphore::~Semaphore() -{ - rt_sem_detach(&mID); -} -- cgit v1.3.1