1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include "thread_dbP.h"
- #include <linuxthreads/internals.h>
- #include <alloca.h>
- td_err_e
- td_ta_tsd_iter (const td_thragent_t *ta, td_key_iter_f *callback,
- void *cbdata_p)
- {
- struct pthread_key_struct *keys;
- int pthread_keys_max;
- int cnt;
- LOG ("td_ta_tsd_iter");
-
- if (! ta_ok (ta))
- return TD_BADTA;
- pthread_keys_max = ta->pthread_keys_max;
- keys = (struct pthread_key_struct *) alloca (sizeof (keys[0])
- * pthread_keys_max);
-
- if (ps_pdread (ta->ph, ta->keys, keys,
- sizeof (keys[0]) * pthread_keys_max) != PS_OK)
- return TD_ERR;
-
- for (cnt = 0; cnt < pthread_keys_max; ++cnt)
- if (keys[cnt].in_use
-
- && callback (cnt, keys[cnt].destr, cbdata_p) != 0)
- return TD_DBERR;
- return TD_OK;
- }
|