来源,java创建新线程启动jvm的时候
ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args)
在没有设置-Xss的时候pthread在linux平台上的默认栈大小是多少
pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args)
然后会调用
__pthread_create_2_1函数,这是为什么呢
是因为这个宏的原因 给pthread_create和__pthread_create_2_1牵线搭桥的
versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1);
/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
the version set name to use for e.g. symbols first introduced into
libm in the GLIBC_2.1 version. Definitions of symbols with explicit
versions should look like:
versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
This will define the symbol `foo' with the appropriate default version,
i.e. either GLIBC_2.1 or the "earliest version" specified in
shlib-versions if that is newer. */
# define versioned_symbol(lib, local, symbol, version) \
versioned_symbol_1 (lib, local, symbol, version)
# define versioned_symbol_1(lib, local, symbol, version) \
versioned_symbol_2 (local, symbol, VERSION_##lib##_##version)
# define versioned_symbol_2(local, symbol, name) \
default_symbol_version (local, symbol, name)
# define default_symbol_version(real, name, version) \
_default_symbol_version(real, name, version)
# define _symbol_version(real, name, version) \
.symver real, name##@##version
展开后是这样子的
.symver __pthread_create_2_1, pthread_create@GLIBC_2_1
把关注点放到__pthr