зеркало из https://github.com/github/ruby.git
`native_tls_get()`' should not check results
caller should check the result of `native_tls_get()`.
This commit is contained in:
Родитель
9c9c217045
Коммит
741ac50330
|
@ -102,11 +102,8 @@ typedef pthread_key_t native_tls_key_t;
|
|||
static inline void *
|
||||
native_tls_get(native_tls_key_t key)
|
||||
{
|
||||
void *ptr = pthread_getspecific(key);
|
||||
if (UNLIKELY(ptr == NULL)) {
|
||||
rb_bug("pthread_getspecific returns NULL");
|
||||
}
|
||||
return ptr;
|
||||
// return value should be checked by caller
|
||||
return pthread_getspecific(key);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
@ -44,11 +44,8 @@ typedef DWORD native_tls_key_t; // TLS index
|
|||
static inline void *
|
||||
native_tls_get(native_tls_key_t key)
|
||||
{
|
||||
void *ptr = TlsGetValue(key);
|
||||
if (UNLIKELY(ptr == NULL)) {
|
||||
rb_bug("TlsGetValue() returns NULL");
|
||||
}
|
||||
return ptr;
|
||||
// return value should be checked by caller.
|
||||
return TlsGetValue(key);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Загрузка…
Ссылка в новой задаче