if (0 != pthread_mutex_init(&GC_allocate_ml, &mattr)) {
ABORT("pthread_mutex_init failed");
}
- pthread_mutexattr_destroy(&mattr);
+ (void)pthread_mutexattr_destroy(&mattr);
}
# endif
# endif /* THREADS */
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
if (pthread_attr_getstack(&attr, &stackaddr, &size) == 0
&& stackaddr != NULL) {
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
# ifdef STACK_GROWS_DOWN
stackaddr = (char *)stackaddr + size;
# endif
return (ptr_t)stackaddr;
}
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
}
WARN("pthread_getattr_np or pthread_attr_getstack failed"
" for main thread\n", 0);
if (pthread_attr_getstack(&attr, &(b -> mem_base), &size) != 0) {
ABORT("pthread_attr_getstack failed");
}
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
# ifdef STACK_GROWS_DOWN
b -> mem_base = (char *)(b -> mem_base) + size;
# endif
/* This will call the real pthread function, not our wrapper */
if (pthread_create(&thread, &attr, GC_mprotect_thread, NULL) != 0)
ABORT("pthread_create failed");
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
/* Setup the sigbus handler for ignoring the meaningless SIGBUSs */
# ifdef BROKEN_EXCEPTION_HANDLING
}
}
GC_markers_m1 = i;
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
}
{
size_t stack_size = 0;
if (NULL != attr) {
- pthread_attr_getstacksize(attr, &stack_size);
+ if (pthread_attr_getstacksize(attr, &stack_size) != 0)
+ ABORT("pthread_attr_getstacksize failed");
}
if (0 == stack_size) {
pthread_attr_t my_attr;
- pthread_attr_init(&my_attr);
- pthread_attr_getstacksize(&my_attr, &stack_size);
- pthread_attr_destroy(&my_attr);
+ if (pthread_attr_init(&my_attr) != 0)
+ ABORT("pthread_attr_init failed");
+ if (pthread_attr_getstacksize(&my_attr, &stack_size) != 0)
+ ABORT("pthread_attr_getstacksize failed");
+ (void)pthread_attr_destroy(&my_attr);
}
/* On Solaris 10, with default attr initialization, */
/* stack_size remains 0. Fudge it. */
if (0 != pthread_mutex_init(&mark_mutex, &mattr)) {
ABORT("pthread_mutex_init failed");
}
- pthread_mutexattr_destroy(&mattr);
+ (void)pthread_mutexattr_destroy(&mattr);
}
# endif
}
# endif
GC_COND_INIT();
- pthread_attr_init(&attr);
+ if ((code = pthread_attr_init(&attr)) != 0) {
+ GC_printf("pthread_attr_init failed, error=%d\n", code);
+ FAIL;
+ }
# if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
|| defined(GC_OPENBSD_THREADS)
- pthread_attr_setstacksize(&attr, 1000000);
+ if ((code = pthread_attr_setstacksize(&attr, 1000000)) != 0) {
+ GC_printf("pthread_attr_setstacksize failed, error=%d\n", code);
+ FAIL;
+ }
# endif
n_tests = 0;
# if (defined(MPROTECT_VDB)) && !defined(REDIRECT_MALLOC) \
}
check_heap_stats();
(void)fflush(stdout);
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
# ifdef PTW32_STATIC_LIB
pthread_win32_thread_detach_np ();
pthread_win32_process_detach_np ();
}
}
GC_markers_m1 = i;
- pthread_attr_destroy(&attr);
+ (void)pthread_attr_destroy(&attr);
GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
}