[newlib-cygwin] Cygwin: posix timers: convert timer_tracker::fixup_after_fork to static method

Corinna Vinschen corinna@sourceware.org
Sat Jan 12 20:26:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=92cbaa9f2365da2f94ac54819b9035fe13198400

commit 92cbaa9f2365da2f94ac54819b9035fe13198400
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Jan 11 20:36:46 2019 +0100

    Cygwin: posix timers: convert timer_tracker::fixup_after_fork to static method
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/timer.cc | 6 +++---
 winsup/cygwin/timer.h  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/timer.cc b/winsup/cygwin/timer.cc
index e92cbad..802aa44 100644
--- a/winsup/cygwin/timer.cc
+++ b/winsup/cygwin/timer.cc
@@ -284,8 +284,8 @@ timer_tracker::clean_and_unhook ()
 void
 timer_tracker::fixup_after_fork ()
 {
-  hcancel = syncthread = NULL;
-  for (timer_tracker *tt = this; tt->next != NULL; /* nothing */)
+  ttstart.hcancel = ttstart.syncthread = NULL;
+  for (timer_tracker *tt = &ttstart; tt->next != NULL; /* nothing */)
     {
       timer_tracker *deleteme = tt->next;
       tt->next = deleteme->next;
@@ -297,7 +297,7 @@ timer_tracker::fixup_after_fork ()
 void
 fixup_timers_after_fork ()
 {
-  ttstart.fixup_after_fork ();
+  timer_tracker::fixup_after_fork ();
 }
 
 extern "C" int
diff --git a/winsup/cygwin/timer.h b/winsup/cygwin/timer.h
index 9a35eb3..4a961fc 100644
--- a/winsup/cygwin/timer.h
+++ b/winsup/cygwin/timer.h
@@ -35,7 +35,7 @@ class timer_tracker
   int clean_and_unhook ();
 
   DWORD thread_func ();
-  void fixup_after_fork ();
+  static void fixup_after_fork ();
 };
 
 #endif /* __TIMER_H__ */



More information about the Cygwin-cvs mailing list