Skip to content

Commit

Permalink
Misc threading related compilation fixes
Browse files Browse the repository at this point in the history
* Without threading enabled
* On archs without known way to emit ELF thread pointers (ARMv6, power)

  Fix #24051
  • Loading branch information
yuyichao committed Oct 9, 2017
1 parent 19b3ca7 commit d7bbdfe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/julia_threads.h
Expand Up @@ -81,7 +81,7 @@ typedef struct {

// This includes all the thread local states we care about for a thread.
#define JL_MAX_BT_SIZE 80000
typedef struct _jl_tls_states_t {
struct _jl_tls_states_t {
struct _jl_gcframe_t *pgcstack;
size_t world_age;
struct _jl_value_t *exception_in_transit;
Expand Down Expand Up @@ -130,7 +130,7 @@ typedef struct _jl_tls_states_t {
int finalizers_inhibited;
arraylist_t finalizers;
jl_gc_mark_cache_t gc_cache;
} jl_tls_states_t;
};

// Update codegen version in `ccall.cpp` after changing either `pause` or `wake`
#ifdef __MIC__
Expand Down
1 change: 1 addition & 0 deletions src/llvm-ptls.cpp
Expand Up @@ -136,6 +136,7 @@ static Instruction *emit_ptls_tp(LLVMContext &ctx, Value *offset, Type *T_ppjlva
#elif defined(_CPU_X86_)
const char *asm_str = "movl %gs:0, $0";
#else
const char *asm_str = nullptr;
assert(0 && "Cannot emit thread pointer for this architecture.");
#endif
if (!offset) {
Expand Down
4 changes: 3 additions & 1 deletion src/tls.h
Expand Up @@ -16,7 +16,9 @@ static inline unsigned long JL_CONST_FUNC jl_thread_self(void)
#endif
}

typedef struct _jl_tls_states_t *jl_ptls_t;
typedef struct _jl_tls_states_t jl_tls_states_t;

typedef jl_tls_states_t *jl_ptls_t;

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit d7bbdfe

Please sign in to comment.