summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-04-26 23:09:41 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:58 +0200
commit55c48e217fac1f752c19c36895f634beb2ba0dae (patch)
tree4135804752f4633935e37effe4ddd6e7a953325b /os_dep.c
parent782c5a03ff94e2e2c4ec90ab40e6302a083e8abf (diff)
2011-04-26 Ivan Maidanski <ivmai@mail.ru>
* .cvsignore (initsecondarythread, test_cpp): Add. * os_dep.c (GC_linux_stack_base): Rename to GC_linux_main_stack_base. * os_dep.c (GC_freebsd_stack_base): Rename to GC_freebsd_main_stack_base; adjust error message. * pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED as an argument for sem_init(). * pthread_support.c (pthread_create): Ditto. * pthread_support.c (pthread_create): Abort in case sem_init() fails. * include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define. * tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT from main() if it should be done from the primordial thread only.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/os_dep.c b/os_dep.c
index a3e7a28..39ca438 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -1038,7 +1038,7 @@ GC_INNER word GC_page_size = 0;
}
# endif /* IA64 */
- STATIC ptr_t GC_linux_stack_base(void)
+ STATIC ptr_t GC_linux_main_stack_base(void)
{
/* We read the stack base value from /proc/self/stat. We do this */
/* using direct I/O system calls in order to avoid calling malloc */
@@ -1124,15 +1124,13 @@ GC_INNER word GC_page_size = 0;
# include <sys/types.h>
# include <sys/sysctl.h>
- STATIC ptr_t GC_freebsd_stack_base(void)
+ STATIC ptr_t GC_freebsd_main_stack_base(void)
{
int nm[2] = {CTL_KERN, KERN_USRSTACK};
ptr_t base;
size_t len = sizeof(ptr_t);
int r = sysctl(nm, 2, &base, &len, NULL, 0);
-
- if (r) ABORT("Error getting stack base");
-
+ if (r) ABORT("Error getting main stack base");
return base;
}
#endif /* FREEBSD_STACKBOTTOM */
@@ -1192,10 +1190,10 @@ GC_INNER word GC_page_size = 0;
# endif
# endif /* HEURISTIC1 */
# ifdef LINUX_STACKBOTTOM
- result = GC_linux_stack_base();
+ result = GC_linux_main_stack_base();
# endif
# ifdef FREEBSD_STACKBOTTOM
- result = GC_freebsd_stack_base();
+ result = GC_freebsd_main_stack_base();
# endif
# ifdef HEURISTIC2
# ifdef STACK_GROWS_DOWN