On some Unix-like platforms Collector.cpp fails to compile because pthread.h does not get included. The problem might be specific to those WebKit ports where neither WTF_USE_PTHREADS nor JSC_MULTIPLE_THREADS is defined (e.g. Qt port on Linux/FREEBSD/NETBSD). The currentThreadStackBase() in Collector.cpp calls pthread_self() on most Unix-like platforms. OPENBSD includes pthread.h explicitly but none of the other Unix-like platforms do so. On the Qt Linux WebKit build, pthread.h gets implicitly included from algorithm, which makes the Qt Unix-like builds dependent on a particular STL implementation.
Created attachment 29680 [details] Proposed fix to include pthread.h in most Unix-like platforms (not just for OPENBSD) in Collector.cpp.
Comment on attachment 29680 [details] Proposed fix to include pthread.h in most Unix-like platforms (not just for OPENBSD) in Collector.cpp. > > #if PLATFORM(SOLARIS) > #include <thread.h> > -#endif > - > -#if PLATFORM(OPENBSD) > +#else > #include <pthread.h> > #endif > I'm not convinced why including this for WINDOWS and DARWIN is a good idea.
(In reply to comment #2) > (From update of attachment 29680 [details] [review]) > > > > #if PLATFORM(SOLARIS) > > #include <thread.h> > > -#endif > > - > > -#if PLATFORM(OPENBSD) > > +#else > > #include <pthread.h> > > #endif > > > I'm not convinced why including this for WINDOWS and DARWIN is a good idea. This entire code segment is guarded with #if PLATFORM(DARWIN) #elif PLATFORM(WIN_OS) #elif PLATFORM(UNIX) so pthread.h won't be included for WIN_OS and DARWIN. I realize that the diff does not show enough context in this case. With this additional information, I will put up the patch for review again.
Comment on attachment 29680 [details] Proposed fix to include pthread.h in most Unix-like platforms (not just for OPENBSD) in Collector.cpp. Seems OK, r=me But maybe HAVE_PTHREAD_H would be an even more reliable way of doing this.
Landed in r43698.