PlatformMutex.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /** \addtogroup platform */
  2. /** @{*/
  3. /**
  4. * \defgroup platform_PlatformMutex PlatformMutex class
  5. * @{
  6. */
  7. /* mbed Microcontroller Library
  8. * Copyright (c) 2006-2013 ARM Limited
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. #ifndef PLATFORM_MUTEX_H
  23. #define PLATFORM_MUTEX_H
  24. #include "platform/NonCopyable.h"
  25. #ifdef MBED_CONF_RTOS_PRESENT
  26. #include "rtos/Mutex.h"
  27. typedef rtos::Mutex PlatformMutex;
  28. #else
  29. /** A stub mutex for when an RTOS is not present
  30. */
  31. class PlatformMutex : private mbed::NonCopyable<PlatformMutex> {
  32. public:
  33. PlatformMutex()
  34. {
  35. // Stub
  36. }
  37. ~PlatformMutex()
  38. {
  39. // Stub
  40. }
  41. void lock()
  42. {
  43. // Do nothing
  44. }
  45. void unlock()
  46. {
  47. // Do nothing
  48. }
  49. };
  50. #endif
  51. #endif
  52. /**@}*/
  53. /**@}*/