From 8103fed4090e9f1457fb1705e9a4df0821f5db9b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 31 Oct 2013 14:40:33 +0100 Subject: ose,erts: Specify name for tsd keys This simplified debugging on OSE and also limits the number of ppdata keys that are created when beam is restarted. --- erts/lib_src/ose/ethread.c | 9 +-------- erts/lib_src/pthread/ethread.c | 2 +- erts/lib_src/win/ethread.c | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) (limited to 'erts/lib_src') diff --git a/erts/lib_src/ose/ethread.c b/erts/lib_src/ose/ethread.c index 01d58e65b2..41c3392677 100644 --- a/erts/lib_src/ose/ethread.c +++ b/erts/lib_src/ose/ethread.c @@ -527,10 +527,8 @@ ethr_leave_ts_event(ethr_ts_event *tsep) */ int -ethr_tsd_key_create(ethr_tsd_key *keyp) +ethr_tsd_key_create(ethr_tsd_key *keyp, char *keyname) { - ethr_tid *tid = ETHR_GET_OWN_TID__; - char keyname[31]; #if ETHR_XCHK if (ethr_not_inited__) { @@ -542,11 +540,6 @@ ethr_tsd_key_create(ethr_tsd_key *keyp) return EINVAL; } #endif - if (tid->tsd_key_index > 999) - return EAGAIN; - - /* What do we do it tds_key_index happens to wrap? Slot search? */ - sprintf(keyname,"ethread_tsd_key_0x%x_%d",tid->id,tid->tsd_key_index++); ose_create_ppdata(keyname,keyp); diff --git a/erts/lib_src/pthread/ethread.c b/erts/lib_src/pthread/ethread.c index fb7d135418..7f27b5f29c 100644 --- a/erts/lib_src/pthread/ethread.c +++ b/erts/lib_src/pthread/ethread.c @@ -472,7 +472,7 @@ ethr_leave_ts_event(ethr_ts_event *tsep) */ int -ethr_tsd_key_create(ethr_tsd_key *keyp) +ethr_tsd_key_create(ethr_tsd_key *keyp, char *keyname) { #if ETHR_XCHK if (ethr_not_inited__) { diff --git a/erts/lib_src/win/ethread.c b/erts/lib_src/win/ethread.c index 3abda6de4c..14d0b6deff 100644 --- a/erts/lib_src/win/ethread.c +++ b/erts/lib_src/win/ethread.c @@ -520,7 +520,7 @@ ethr_equal_tids(ethr_tid tid1, ethr_tid tid2) */ int -ethr_tsd_key_create(ethr_tsd_key *keyp) +ethr_tsd_key_create(ethr_tsd_key *keyp, char *keyname) { DWORD key; #if ETHR_XCHK -- cgit v1.2.3