Skip to content

Commit

Permalink
Remove some #if __cplusplus wrt inlining. (#32519)
Browse files Browse the repository at this point in the history
The code is fine, and we should put it back at some point,
but I want things to be clearer regarding mono/mono#18827.

i.e. That this does not cause it.
I don't know what does cause it, granted.
Maybe a preexisting race condition/deadlock, I don't know.

Repro is run a loop like:
```
type \s\1.cmd
for /l %%a in (1 1 999) do echo %%a && C:\s\mono2\msvc\build\sgen\x64\bin\Release\mono-sgen.exe \s\mono2\mono\tests\bug-10127.exe
```

Co-authored-by: Jay Krell <[email protected]>
  • Loading branch information
monojenkins and jaykrell authored Feb 19, 2020
1 parent 5d8f924 commit 9d85b82
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/mono/mono/utils/mono-tls-inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,66 +31,66 @@ mono_tls_get_tls_offset (MonoTlsKey key)
// Casts on getters are for the !MONO_KEYWORD_THREAD case.

/* Getters for each tls key */
MONO_INLINE
static inline
MonoInternalThread *mono_tls_get_thread (void)
{
return (MonoInternalThread*)MONO_TLS_GET_VALUE (mono_tls_thread, mono_tls_key_thread);
}

#define mono_get_jit_tls mono_tls_get_jit_tls

MONO_INLINE
static inline
MonoJitTlsData *mono_tls_get_jit_tls (void)
{
return (MonoJitTlsData*)MONO_TLS_GET_VALUE (mono_tls_jit_tls, mono_tls_key_jit_tls);
}

MONO_INLINE
static inline
MonoDomain *mono_tls_get_domain (void)
{
return (MonoDomain*)MONO_TLS_GET_VALUE (mono_tls_domain, mono_tls_key_domain);
}

MONO_INLINE
static inline
SgenThreadInfo *mono_tls_get_sgen_thread_info (void)
{
return (SgenThreadInfo*)MONO_TLS_GET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info);
}

#define mono_get_lmf_addr mono_tls_get_lmf_addr

MONO_INLINE
static inline
MonoLMF **mono_tls_get_lmf_addr (void)
{
return (MonoLMF**)MONO_TLS_GET_VALUE (mono_tls_lmf_addr, mono_tls_key_lmf_addr);
}

/* Setters for each tls key */
MONO_INLINE
static inline
void mono_tls_set_thread (MonoInternalThread *value)
{
MONO_TLS_SET_VALUE (mono_tls_thread, mono_tls_key_thread, value);
}

MONO_INLINE
static inline
void mono_tls_set_jit_tls (MonoJitTlsData *value)
{
MONO_TLS_SET_VALUE (mono_tls_jit_tls, mono_tls_key_jit_tls, value);
}

MONO_INLINE
static inline
void mono_tls_set_domain (MonoDomain *value)
{
MONO_TLS_SET_VALUE (mono_tls_domain, mono_tls_key_domain, value);
}

MONO_INLINE
static inline
void mono_tls_set_sgen_thread_info (SgenThreadInfo *value)
{
MONO_TLS_SET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info, value);
}

MONO_INLINE
static inline
void mono_tls_set_lmf_addr (MonoLMF **value)
{
MONO_TLS_SET_VALUE (mono_tls_lmf_addr, mono_tls_key_lmf_addr, value);
Expand Down

0 comments on commit 9d85b82

Please sign in to comment.