|
From: <sv...@va...> - 2009-04-01 21:38:31
|
Author: sewardj
Date: 2009-04-01 22:37:37 +0100 (Wed, 01 Apr 2009)
New Revision: 9509
Log:
os_state_clear: initialise Darwin-specific fields. Prior to this commit
only the Linux- and AIX5- specific fields were cleared.
Modified:
branches/DARWIN/coregrind/m_scheduler/scheduler.c
branches/DARWIN/coregrind/pub_core_threadstate.h
Modified: branches/DARWIN/coregrind/m_scheduler/scheduler.c
===================================================================
--- branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-04-01 21:18:14 UTC (rev 9508)
+++ branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-04-01 21:37:37 UTC (rev 9509)
@@ -399,10 +399,25 @@
{
tst->os_state.lwpid = 0;
tst->os_state.threadgroup = 0;
-# if defined(VGO_aix5)
+# if defined(VGO_linux)
+ /* no other fields to clear */
+# elif defined(VGO_aix5)
tst->os_state.cancel_async = False;
tst->os_state.cancel_disabled = False;
tst->os_state.cancel_progress = Canc_NoRequest;
+# elif defined(VGO_darwin)
+ tst->os_state.post_mach_trap_fn = NULL;
+ tst->os_state.pthread = 0;
+ tst->os_state.func_arg = 0;
+ VG_(memset)(&tst->os_state.child_go, 0, sizeof(tst->os_state.child_go));
+ VG_(memset)(&tst->os_state.child_done, 0, sizeof(tst->os_state.child_done));
+ tst->os_state.wq_jmpbuf_valid = False;
+ VG_(memset)(&tst->os_state.wq_jmpbuf, 0, sizeof(tst->os_state.wq_jmpbuf));
+ tst->os_state.remote_port = 0;
+ tst->os_state.msgh_id = 0;
+ VG_(memset)(&tst->os_state.mach_args, 0, sizeof(tst->os_state.mach_args));
+# else
+# error "Unknown OS"
# endif
}
Modified: branches/DARWIN/coregrind/pub_core_threadstate.h
===================================================================
--- branches/DARWIN/coregrind/pub_core_threadstate.h 2009-04-01 21:18:14 UTC (rev 9508)
+++ branches/DARWIN/coregrind/pub_core_threadstate.h 2009-04-01 21:37:37 UTC (rev 9509)
@@ -117,7 +117,9 @@
ThreadArchState;
-/* OS-specific thread state */
+/* OS-specific thread state. IMPORTANT: if you add fields to this,
+ you _must_ add code to os_state_clear() to initialise those
+ fields. */
typedef
struct {
/* who we are */
@@ -270,7 +272,7 @@
char *path;
} io_registry_entry_from_path;
} mach_args;
-# endif
+# endif
}
ThreadOSstate;
|