Skip to content

Commit

Permalink
Fix up missing _Atomic calls
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Oct 28, 2021
1 parent 516d9ba commit a8b0653
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bigval_t *big_objects_marked = NULL;
// `to_finalize` should not have tagged pointers.
arraylist_t finalizer_list_marked;
arraylist_t to_finalize;
int jl_gc_have_pending_finalizers = 0;
JL_DLLEXPORT _Atomic(int) jl_gc_have_pending_finalizers = 0;

NOINLINE uintptr_t gc_get_stack_ptr(void)
{
Expand Down
4 changes: 2 additions & 2 deletions src/julia_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ typedef struct _jl_tls_states_t {
uv_mutex_t sleep_lock;
uv_cond_t wake_signal;
volatile sig_atomic_t defer_signal;
struct _jl_task_t *current_task;
_Atomic(struct _jl_task_t*) current_task;
struct _jl_task_t *next_task;
struct _jl_task_t *previous_task;
struct _jl_task_t *root_task;
Expand Down Expand Up @@ -347,7 +347,7 @@ JL_DLLEXPORT void jl_gc_enable_finalizers(struct _jl_task_t *ct, int on);
JL_DLLEXPORT void jl_gc_disable_finalizers_internal(void);
JL_DLLEXPORT void jl_gc_enable_finalizers_internal(void);
JL_DLLEXPORT void jl_gc_run_pending_finalizers(struct _jl_task_t *ct);
extern JL_DLLEXPORT int jl_gc_have_pending_finalizers;
extern JL_DLLEXPORT _Atomic(int) jl_gc_have_pending_finalizers;

JL_DLLEXPORT void jl_wakeup_thread(int16_t tid);

Expand Down
4 changes: 2 additions & 2 deletions src/partr.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern int jl_gc_mark_queue_obj_explicit(jl_gc_mark_cache_t *gc_cache,
typedef struct taskheap_tag {
uv_mutex_t lock;
jl_task_t **tasks;
int32_t ntasks;
_Atomic(int32_t) ntasks;
_Atomic(int16_t) prio;
} taskheap_t;

Expand Down Expand Up @@ -414,7 +414,7 @@ static int may_sleep(jl_ptls_t ptls) JL_NOTSAFEPOINT
return jl_atomic_load_relaxed(&ptls->sleep_check_state) == sleeping;
}

extern unsigned _threadedregion;
extern _Atomic(unsigned) _threadedregion;

JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q)
{
Expand Down
2 changes: 1 addition & 1 deletion src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void jl_start_threads(void)
uv_barrier_wait(&thread_init_done);
}

unsigned volatile _threadedregion; // HACK: keep track of whether it is safe to do IO
_Atomic(unsigned) _threadedregion; // HACK: keep track of whether it is safe to do IO

JL_DLLEXPORT int jl_in_threaded_region(void)
{
Expand Down

0 comments on commit a8b0653

Please sign in to comment.