Skip to content

Commit

Permalink
Revert "[Cosmetic]: Municipal Inflation Cache: update code comment (#163
Browse files Browse the repository at this point in the history
)"

This reverts commit eb0a568.
  • Loading branch information
Jonathansumner authored Aug 8, 2023
1 parent eb0a568 commit 154995e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions x/mint/cache/municipal_inflation_cahe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@ type MunicipalInflationCache struct {
}

var (
// GMunicipalInflationCache Thread safety:
// As the things stand now from design & impl. perspective:
// 1. This global variable is supposed to be initialised(= its value set)
// just *ONCE* here, at this place,
// 2. This global variable is *NOT* used anywhere else in the initialisation
// context of the *global scope* - e.g. as input for initialisation of
// another global variable, etc. ...
// 3. All *exported* methods of `MunicipalInflationCache` type *ARE* thread safe,
// and so can be called from anywhere, *EXCEPT* from the initialisation context
// of the global scope(implication of the point 2 above)!
// NOTE(pb): This is *NOT* thread safe.
// However, in our case, this global variable is by design
// *NOT* supposed to be accessed simultaneously in multiple
// different threads, or in global scope somewhere else.
// Once such requirements arise, concept of this global variable
// needs to be changed to something what is thread safe.
GMunicipalInflationCache = MunicipalInflationCache{}
)

Expand Down

0 comments on commit 154995e

Please sign in to comment.