Skip to content

Conversation

hnakamur
Copy link
Contributor

@hnakamur hnakamur commented Aug 7, 2019

This pull request adds ngx_http_lua_ffi_shdict_store_when
which is used to define set_when and safe_set_when methods in ngx.shared.DICT.

These methods are useful for avoiding race conditions between successive calls of get and set.
You pass old_value as well as value to set_when, and it changes the value only when the value for the key is still the same as old_value.
Adding this method is suggested in the comment by @doujiang24.

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

@hnakamur
Copy link
Contributor Author

hnakamur commented Aug 8, 2019

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.

1 participant