Closed fysu closed 3 years ago
源代码 struct FiberScopedGuard { FiberScopedGuard::FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } FiberScopedGuard::~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; } static void*& GetTlsContext() { static thread_local void* native = nullptr; return native; } }; 结构里的函数就不要使用限定符了,貌似gcc允许这么写??? 修改后 struct FiberScopedGuard { FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } ~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; } static void*& GetTlsContext() { static thread_local void* native = nullptr; return native; } };
源代码
struct FiberScopedGuard { FiberScopedGuard::FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } FiberScopedGuard::~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; } static void*& GetTlsContext() { static thread_local void* native = nullptr; return native; } };
结构里的函数就不要使用限定符了,貌似gcc允许这么写??? 修改后
struct FiberScopedGuard { FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } ~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; } static void*& GetTlsContext() { static thread_local void* native = nullptr; return native; } };
首先感谢开源这个携程库,这其实也不是些啥大问题,就只是一些小问题吧,还是提出来说下
版本是4ebfd4c
最后再次感谢魅族团队开源的libgo