aboutsummaryrefslogblamecommitdiff
path: root/www/chromium/files/patch-base_message__loop_message__pump__glib.cc
blob: 047712904c6fda0211bcfcf1128a22add3b5407a (plain) (tree)
1
2
3
4
5
6
7
                                                                       




                                          
                      




                          
                             
                                            
                                                                         


                             
                      








                                           
--- base/message_loop/message_pump_glib.cc.orig	2022-02-28 16:54:41 UTC
+++ base/message_loop/message_pump_glib.cc
@@ -8,6 +8,11 @@
 #include <glib.h>
 #include <math.h>
 
+#if BUILDFLAG(IS_BSD)
+#include <pthread.h>
+#include <pthread_np.h>
+#endif
+
 #include "base/logging.h"
 #include "base/notreached.h"
 #include "base/numerics/safe_conversions.h"
@@ -50,9 +55,13 @@ int GetTimeIntervalMilliseconds(TimeTicks next_task_ti
 }
 
 bool RunningOnMainThread() {
+#if BUILDFLAG(IS_BSD)
+  return pthread_main_np();
+#else
   auto pid = getpid();
   auto tid = PlatformThread::CurrentId();
   return pid > 0 && tid > 0 && pid == tid;
+#endif
 }
 
 // A brief refresher on GLib: