-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Reduce custom operator behavior in the Volatile<T> structure #124244
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
base: main
Are you sure you want to change the base?
Changes from all commits
a47fd3e
fe831be
bfd4e80
5ff1a7e
5e8fae3
de8a9f2
42e39c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,6 +52,9 @@ Returns TRUE if the PAL is in an initialized state | |||||
| Warning : this will only report the PAL's state at the moment it is called. | ||||||
| If it is necessary to ensure the PAL remains initialized (or not) while doing | ||||||
| some work, the Initialization lock (PALInitLock()) should be held. | ||||||
|
|
||||||
| Note: init_count is Volatile<int> which means that the read here has a read barrier | ||||||
|
||||||
| Note: init_count is Volatile<int> which means that the read here has a read barrier | |
| Note: init_count is Volatile<INT> which means that the read here has a read barrier |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -588,7 +588,9 @@ Initialize( | |
| } | ||
|
|
||
| TRACE("First-time PAL initialization complete.\n"); | ||
| init_count++; | ||
| // Incrementing the init_count here serves as a synchronization point, | ||
| // since it is a Volatile<T> variable, and modifying it will have release semantics. | ||
| init_count.Store(init_count.Load() + 1); | ||
|
Comment on lines
+591
to
+593
|
||
|
|
||
| /* Set LastError to a non-good value - functions within the | ||
| PAL startup may set lasterror to a nonzero value. */ | ||
|
|
@@ -597,7 +599,7 @@ Initialize( | |
| } | ||
| else | ||
| { | ||
| init_count++; | ||
| init_count.Store(init_count.Load() + 1); | ||
|
|
||
| TRACE("Initialization count increases to %d\n", init_count.Load()); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.