X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=libgc%2Fmisc.c;h=5b2868d808b691d90fd521f01e6b28757f5c86f9;hb=20a42782e9fc05f6d75b03dbb76e5f6e7d303cf8;hp=22fc564c89518bc08b2d1f19b695beac1c048e14;hpb=9ee1c60455977473bd2144d82233f09913e0caa6;p=mono.git diff --git a/libgc/misc.c b/libgc/misc.c index 22fc564c895..5b2868d808b 100644 --- a/libgc/misc.c +++ b/libgc/misc.c @@ -64,7 +64,10 @@ /* Used only for assertions, and to prevent */ /* recursive reentry in the system call wrapper. */ # endif -# else +# elif defined(SN_TARGET_PS3) + #include + pthread_mutex_t GC_allocate_ml; +# else --> declare allocator lock here # endif # endif @@ -470,7 +473,7 @@ size_t GC_get_total_bytes GC_PROTO(()) int GC_get_suspend_signal GC_PROTO(()) { -#if defined(SIG_SUSPEND) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS) +#if defined(SIG_SUSPEND) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS) && !defined(GC_OPENBSD_THREADS) return SIG_SUSPEND; #else return -1; @@ -481,6 +484,10 @@ GC_bool GC_is_initialized = FALSE; void GC_init() { +#if defined(SN_TARGET_PS3) + pthread_mutexattr_t mattr; +#endif + DCL_LOCK_STATE; DISABLE_SIGNALS(); @@ -498,6 +505,13 @@ void GC_init() InitializeCriticalSection (&GC_allocate_ml); } #endif /* MSWIN32 */ +#if defined(SN_TARGET_PS3) + pthread_mutexattr_init (&mattr); + + pthread_mutex_init (&GC_allocate_ml, &mattr); + pthread_mutexattr_destroy (&mattr); + +#endif LOCK(); GC_init_inner(); @@ -670,7 +684,7 @@ void GC_init_inner() # if defined(SEARCH_FOR_DATA_START) GC_init_linux_data_start(); # endif -# if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__) +# if defined(NETBSD) && defined(__ELF__) GC_init_netbsd_elf(); # endif # if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \