1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     os_Mutex.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 25116 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_OS_MUTEX_H_
17 #define NW_OS_MUTEX_H_
18 
19 #include <nw/types.h>
20 #include <nw/config/macros.h>
21 
22 #include NW_ADAPTIVE_HEADER(nw/os/platform/os_Mutex, NW_PLATFORM_NAME.h)
23 
24 namespace nw {
25 namespace os {
26 
27 //---------------------------------------------------------------------------
28 //! @brief        排他をおこなうロックオブジェクトです。
29 //---------------------------------------------------------------------------
30 typedef nw::os::internal::LockObject LockObject;
31 
32 //---------------------------------------------------------------------------
33 //! @brief        空のロックオブジェクトです。
34 //---------------------------------------------------------------------------
35 class NullLockObject
36 {
37 public:
38     //---------------------------------------------------------------------------
39     //! @brief        ロックをおこないます。
40     //---------------------------------------------------------------------------
Lock()41     void Lock() {}
42 
43     //---------------------------------------------------------------------------
44     //! @brief        ロックの取得を試みて、失敗した場合は false を返します。
45     //!
46     //! @return       ロックに成功した場合は true、失敗した場合は false を返します。
47     //---------------------------------------------------------------------------
TryLock()48     bool TryLock() { return true; }
49 
50     //---------------------------------------------------------------------------
51     //! @brief        ロックを解除します。
52     //---------------------------------------------------------------------------
Unlock()53     void Unlock()  {}
54 };
55 
56 } // namespace os
57 } // namespace nw
58 
59 #endif /* NW_OS_MUTEX_H_ */
60 
61