1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: os_ThreadLocalStorage.h 4 5 Copyright (C)2009 Nintendo Co., Ltd. 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 $Rev: 38879 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* Please see man pages for details 17 18 19 20 */ 21 #ifndef NN_OS_OS_THREADLOCALSTORAGE_H_ 22 #define NN_OS_OS_THREADLOCALSTORAGE_H_ 23 24 #include <nn/types.h> 25 26 #ifdef __cplusplus 27 28 namespace nn{ namespace os{ 29 30 namespace detail 31 { 32 void InitializeThreadEnvrionment(); 33 } 34 35 /* Please see man pages for details 36 37 38 39 40 41 42 43 44 45 46 */ 47 class ThreadLocalStorage 48 { 49 public: 50 51 /* Please see man pages for details 52 53 */ 54 ThreadLocalStorage(); 55 56 /* Please see man pages for details 57 58 */ 59 ~ThreadLocalStorage(); 60 61 /* Please see man pages for details 62 63 64 65 */ 66 uptr GetValue() const; 67 68 /* Please see man pages for details 69 70 71 72 73 */ 74 void SetValue(uptr value); 75 76 private: 77 78 // Slot number 79 s32 m_Index; 80 81 friend void nn::os::detail::InitializeThreadEnvrionment(); 82 83 // Clear the values stored in all slots. 84 static void ClearAllSlots(); 85 86 }; 87 88 }} // namespace nn::os 89 90 #endif // __cplusplus 91 92 /* NN_OS_OS_THREADLOCALSTORAGE_H_ */ 93 #endif /* NN_OS_OS_THREADLOCALSTORAGE_H_ */ 94