YSTest: POSIXThread.h 源文件

YSTest PreAlpha_b800_20170810 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

POSIXThread.h
浏览该文件的文档.
1 /*
2 © 2014 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
29 #ifndef YCL_INC_POSIXThread_h_
30 #define YCL_INC_POSIXThread_h_ 1
31
32 #include "YModules.h"
33 #include YFM_YCLib_Platform
34 #include <ydef.h>
35 #if YF_Use_POSIXThread
36 # include <pthread.h>
37 # include YFM_YBaseMacro // for DefGetter, PDefH, ImplRet;
38
39 namespace platform_ex
40 {
41
42 class TLSKey
43 {
44 private:
45 ::pthread_key_t key;
46
47 public:
48 TLSKey(void(*)(void*));
49 ~TLSKey();
50
51 DefGetter(const ynothrow, void*, Value, ::pthread_getspecific(key))
52
53 PDefH(int, SetValue, const void* value)
54 ImplRet(::pthread_setspecific(key, value))
55 };
56
57 } // namespace platform_ex;
58
59 #endif
60
61 #endif
62
ydef.h
系统环境和公用类型和宏的基础定义。
platform_ex::ImplRet
const char16_t *s ImplRet(platform::Nonnull(s)) inline PDefH(const u16string &
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:766
YModules.h
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:241
platform_ex
平台扩展命名空间。
Definition: Android.h:45