@@ -30,17 +30,18 @@ static ts_fn_hint ts_info;
3030// Thread data to transmit to JS
3131static int ints [ARRAY_LENGTH ];
3232
33- static void secondary_thread (void * data ) {
33+ static void * secondary_thread (void * data ) {
3434 napi_threadsafe_function ts_fn = data ;
3535
3636 if (napi_release_threadsafe_function (ts_fn , napi_tsfn_release ) != napi_ok ) {
3737 napi_fatal_error ("secondary_thread" , NAPI_AUTO_LENGTH ,
3838 "napi_release_threadsafe_function failed" , NAPI_AUTO_LENGTH );
3939 }
40+ return NULL ;
4041}
4142
4243// Source thread producing the data
43- static void data_source_thread (void * data ) {
44+ static void * data_source_thread (void * data ) {
4445 napi_threadsafe_function ts_fn = data ;
4546 int index ;
4647 void * hint ;
@@ -67,7 +68,7 @@ static void data_source_thread(void* data) {
6768 "napi_acquire_threadsafe_function failed" , NAPI_AUTO_LENGTH );
6869 }
6970
70- if (uv_thread_create (& uv_threads [1 ], secondary_thread , ts_fn ) != 0 ) {
71+ if (uv_thread_create (& uv_threads [1 ], ( uv_thread_cb ) secondary_thread , ts_fn ) != 0 ) {
7172 napi_fatal_error ("data_source_thread" , NAPI_AUTO_LENGTH ,
7273 "failed to start secondary thread" , NAPI_AUTO_LENGTH );
7374 }
@@ -126,6 +127,7 @@ static void data_source_thread(void* data) {
126127 napi_fatal_error ("data_source_thread" , NAPI_AUTO_LENGTH ,
127128 "napi_release_threadsafe_function failed" , NAPI_AUTO_LENGTH );
128129 }
130+ return NULL ;
129131}
130132
131133// Getting the data into JS
@@ -239,7 +241,7 @@ static napi_value StartThreadInternal(napi_env env,
239241 napi_get_value_bool (env , argv [2 ], & (ts_info .start_secondary )));
240242
241243 NAPI_ASSERT (env ,
242- (uv_thread_create (& uv_threads [0 ], data_source_thread , ts_fn ) == 0 ),
244+ (uv_thread_create (& uv_threads [0 ], ( uv_thread_cb ) data_source_thread , ts_fn ) == 0 ),
243245 "Thread creation" );
244246
245247 return NULL ;
0 commit comments