forked

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PlatformMutex.h Source File

PlatformMutex.h

00001 
00002 /** \addtogroup platform */
00003 /* mbed Microcontroller Library
00004  * Copyright (c) 2006-2013 ARM Limited
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 #ifndef PLATFORM_MUTEX_H
00019 #define PLATFORM_MUTEX_H
00020 
00021 #include "platform/NonCopyable.h"
00022 
00023 #ifdef MBED_CONF_RTOS_PRESENT
00024 #include "rtos/Mutex.h"
00025 typedef rtos::Mutex PlatformMutex;
00026 #else
00027 /** A stub mutex for when an RTOS is not present
00028  * @ingroup platform
00029 */
00030 class PlatformMutex : private mbed::NonCopyable<PlatformMutex> {
00031 public:
00032     PlatformMutex() {
00033         // Stub
00034 
00035     }
00036     ~PlatformMutex() {
00037         // Stub
00038     }
00039 
00040     void lock() {
00041         // Do nothing
00042     }
00043 
00044     void unlock() {
00045         // Do nothing
00046     }
00047 };
00048 
00049 #endif
00050 
00051 #endif
00052