Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Julia] Use best practices for locking strategies #5905

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Jan 13, 2023

This PR changes the way we use locks in our Julia client to best practices as recommended in https://docs.julialang.org/en/v1/manual/multi-threading/#Data-race-freedom

@Mytherin Mytherin merged commit fc2ef03 into duckdb:master Jan 13, 2023
Comment on lines +51 to +58
begin
lock(main_function.global_lock)
try
push!(main_function.global_objects, object)
finally
unlock(main_function.global_lock)
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more compact?

lock(main_function.global_lock) do
    push!(main_function.global_objects, object)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants