@@ -309,15 +309,15 @@ cancel_fast_fallback(void *ptr)
309309
310310 struct fast_fallback_getaddrinfo_shared * arg = (struct fast_fallback_getaddrinfo_shared * )ptr ;
311311
312- rb_nativethread_lock_lock (arg -> lock );
312+ rb_nativethread_lock_lock (& arg -> lock );
313313 {
314314 arg -> cancelled = true;
315315 char notification = SELECT_CANCELLED ;
316316 if (arg -> notify != -1 && (write (arg -> notify , & notification , 1 )) < 0 ) {
317317 rb_syserr_fail (errno , "write(2)" );
318318 }
319319 }
320- rb_nativethread_lock_unlock (arg -> lock );
320+ rb_nativethread_lock_unlock (& arg -> lock );
321321}
322322
323323struct hostname_resolution_result
@@ -595,9 +595,7 @@ init_fast_fallback_inetsock_internal(VALUE v)
595595 arg -> getaddrinfo_shared = allocate_fast_fallback_getaddrinfo_shared (arg -> family_size );
596596 if (!arg -> getaddrinfo_shared ) rb_syserr_fail (errno , "calloc(3)" );
597597
598- arg -> getaddrinfo_shared -> lock = calloc (1 , sizeof (rb_nativethread_lock_t ));
599- if (!arg -> getaddrinfo_shared -> lock ) rb_syserr_fail (errno , "calloc(3)" );
600- rb_nativethread_lock_initialize (arg -> getaddrinfo_shared -> lock );
598+ rb_nativethread_lock_initialize (& arg -> getaddrinfo_shared -> lock );
601599
602600 arg -> getaddrinfo_shared -> notify = hostname_resolution_notifier ;
603601 arg -> getaddrinfo_shared -> cancelled = false;
@@ -1198,7 +1196,7 @@ fast_fallback_inetsock_cleanup(VALUE v)
11981196 int shared_need_free = 0 ;
11991197 int need_free [2 ] = { 0 , 0 };
12001198
1201- rb_nativethread_lock_lock (getaddrinfo_shared -> lock );
1199+ rb_nativethread_lock_lock (& getaddrinfo_shared -> lock );
12021200 {
12031201 for (int i = 0 ; i < arg -> family_size ; i ++ ) {
12041202 if (arg -> getaddrinfo_entries [i ] && -- (arg -> getaddrinfo_entries [i ]-> refcount ) == 0 ) {
@@ -1209,7 +1207,7 @@ fast_fallback_inetsock_cleanup(VALUE v)
12091207 shared_need_free = 1 ;
12101208 }
12111209 }
1212- rb_nativethread_lock_unlock (getaddrinfo_shared -> lock );
1210+ rb_nativethread_lock_unlock (& getaddrinfo_shared -> lock );
12131211
12141212 for (int i = 0 ; i < arg -> family_size ; i ++ ) {
12151213 if (need_free [i ]) free_fast_fallback_getaddrinfo_entry (& arg -> getaddrinfo_entries [i ]);
0 commit comments