@@ -51,8 +51,8 @@ static int resource_types_table_size;
51
51
static MUTEX_T tsmm_mutex ; /* thread-safe memory manager mutex */
52
52
53
53
/* New thread handlers */
54
- static void ( * tsrm_new_thread_begin_handler )() ;
55
- static void ( * tsrm_new_thread_end_handler )() ;
54
+ static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler ;
55
+ static tsrm_thread_end_func_t tsrm_new_thread_end_handler ;
56
56
57
57
/* Debug support */
58
58
int tsrm_error (int level , const char * format , ...);
@@ -254,7 +254,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
254
254
#endif
255
255
256
256
if (tsrm_new_thread_begin_handler ) {
257
- tsrm_new_thread_begin_handler (thread_id );
257
+ tsrm_new_thread_begin_handler (thread_id , & (( * thread_resources_ptr ) -> storage ) );
258
258
}
259
259
for (i = 0 ; i < id_count ; i ++ ) {
260
260
(* thread_resources_ptr )-> storage [i ] = (void * ) malloc (resource_types_table [i ].size );
@@ -266,7 +266,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
266
266
tsrm_mutex_unlock (tsmm_mutex );
267
267
268
268
if (tsrm_new_thread_end_handler ) {
269
- tsrm_new_thread_end_handler (thread_id );
269
+ tsrm_new_thread_end_handler (thread_id , & (( * thread_resources_ptr ) -> storage ) );
270
270
}
271
271
}
272
272
@@ -509,7 +509,7 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
509
509
}
510
510
511
511
512
- TSRM_API void * tsrm_set_new_thread_begin_handler (void ( * new_thread_begin_handler )( THREAD_T thread_id ) )
512
+ TSRM_API void * tsrm_set_new_thread_begin_handler (tsrm_thread_begin_func_t new_thread_begin_handler )
513
513
{
514
514
void * retval = (void * ) tsrm_new_thread_begin_handler ;
515
515
@@ -518,7 +518,7 @@ TSRM_API void *tsrm_set_new_thread_begin_handler(void (*new_thread_begin_handler
518
518
}
519
519
520
520
521
- TSRM_API void * tsrm_set_new_thread_end_handler (void ( * new_thread_end_handler )( THREAD_T thread_id ) )
521
+ TSRM_API void * tsrm_set_new_thread_end_handler (tsrm_thread_end_func_t new_thread_end_handler )
522
522
{
523
523
void * retval = (void * ) tsrm_new_thread_end_handler ;
524
524
0 commit comments