aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/code_ix.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-02-23 12:13:31 +0100
committerSverker Eriksson <[email protected]>2012-02-23 12:19:42 +0100
commit62a41d25361de2ee08970a3905c63c503d3c89a1 (patch)
tree8acc8d513edb8110de52265604e145631657f047 /erts/emulator/beam/code_ix.h
parent6d7073e33a8f326b8a37eaf5539aa322a06a732c (diff)
downloadotp-62a41d25361de2ee08970a3905c63c503d3c89a1.tar.gz
otp-62a41d25361de2ee08970a3905c63c503d3c89a1.tar.bz2
otp-62a41d25361de2ee08970a3905c63c503d3c89a1.zip
erts: Refactor code loading with renaming
Rename lock_code_ix as seize_code_write_permission. Don't want to call it a "lock" as it can be held between schedulings and different threads and is not managed by lock checker. Rename "activate" staging as "commit" staging. Why not be consistent and use git terminology all the way.
Diffstat (limited to 'erts/emulator/beam/code_ix.h')
-rw-r--r--erts/emulator/beam/code_ix.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/erts/emulator/beam/code_ix.h b/erts/emulator/beam/code_ix.h
index c37a5fe8f4..068ff0e6ba 100644
--- a/erts/emulator/beam/code_ix.h
+++ b/erts/emulator/beam/code_ix.h
@@ -81,38 +81,37 @@ ErtsCodeIndex erts_active_code_ix(void);
ERTS_GLB_INLINE
ErtsCodeIndex erts_staging_code_ix(void);
-/* Try lock code_ix that is needed for (exlusive) access of the staging area.
+/* Try seize exclusive code write permission. Needed for code staging.
* Main process lock (only) must be held.
* System thread progress must not be blocked.
* Caller is suspended and *must* yield if 0 is returned.
*/
-int erts_try_lock_code_ix(struct process*);
+int erts_try_seize_code_write_permission(struct process*);
-/* Unlock code_ix
+/* Release code write permission.
+ * Will resume any suspended waiters.
*/
-void erts_unlock_code_ix(void);
+void erts_release_code_write_permission(void);
/* Prepare the "staging area" to be a complete copy of the active code.
- * code_ix must be locked.
- * Must be followed by calls to either "end" and "activate" or "abort" before
- * code_ix lock is released.
+ * Code write permission must have been seized.
+ * Must be followed by calls to either "end" and "commit" or "abort" before
+ * code write permission can be released.
*/
void erts_start_staging_code_ix(void);
/* End the staging.
- * code_ix must be locked.
- * Must be followed by a call to either "activate" or "abort"
- * before code_ix lock is released.
+ * Preceded by "start" and followed by "commit" or "abort".
*/
void erts_end_staging_code_ix(void);
/* Set staging code index as new active code index.
- * code_ix must be locked and "start" and "end" called.
+ * Preceded by "end".
*/
-void erts_activate_staging_code_ix(void);
+void erts_commit_staging_code_ix(void);
/* Abort the staging.
- * code_ix must be locked and "start" called.
+ * Preceded by "start" or "end".
*/
void erts_abort_staging_code_ix(void);