• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

C++ベースのLightweightなHTTPサーバー


Commit MetaInfo

Revision426e9a6532f48c2c213eb03617a54d14e34e0faa (tree)
Time2012-12-16 23:39:14
AuthorMichio Hirai <smg_ykz@user...>
CommiterMichio Hirai

Log Message

[BugFix] Fix the problem that isMainThread() inline function is properly compiled in Linux environment.

Change Summary

Incremental Difference

--- a/inc/cm_thread_is_main_thread.h
+++ b/inc/cm_thread_is_main_thread.h
@@ -4,22 +4,23 @@
44
55 #if __linux__
66 #include <sys/types.h>
7-#include <linux/unistd.h>
7+#include <sys/syscall.h>
8+#include <unistd.h>
89
910 namespace cm {
1011
1112 inline bool isMainThread()
1213 {
13- return gettid() == getpid();
14+ return syscall(SYS_gettid) == getpid();
1415 }
1516
1617 } // namespace
1718
1819 #elif ((__FreeBSD__) || (__MACH__ && __APPLE__))
19-namespace cm {
20-
2120 #include <pthread.h>
2221
22+namespace cm {
23+
2324 inline bool isMainThread()
2425 {
2526 return pthread_main_np();