fixes set_stacksize

This commit is contained in:
Abdul Chaudhry 2019-04-22 09:07:37 -07:00
parent 27aae32ff6
commit c6b9015799
No known key found for this signature in database
GPG Key ID: 8AFBEEBFF93FCF21

View File

@ -293,12 +293,16 @@ set_stacksize( void )
vips_min_stack_size = VIPS_MAX( default_min_stack_size,
vips__parse_size( pstacksize_str ) );
if( cur_stack_size < vips_min_stack_size ||
pthread_attr_setstacksize( &attr, vips_min_stack_size ) ||
pthread_setattr_default_np( &attr ) )
g_warning( _( "could not set minimum pthread stack "
"size of %s, current size is %dk" ),
pstacksize_str, (int) (cur_stack_size / 1024.0) );
if( cur_stack_size < vips_min_stack_size) {
if (pthread_attr_setstacksize( &attr, vips_min_stack_size ) ||
pthread_setattr_default_np( &attr ) ) {
g_warning( _( "could not set minimum pthread stack "
"size of %s, current size is %dk" ),
pstacksize_str, (int) (cur_stack_size / 1024.0) );
}
}
pthread_attr_getstacksize( &attr, &cur_stack_size );
g_info("current stack size is set to %lu", cur_stack_size);
#endif /*HAVE_PTHREAD_DEFAULT_NP*/
}