aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/code_ix.c
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.c
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.c')
-rw-r--r--erts/emulator/beam/code_ix.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/erts/emulator/beam/code_ix.c b/erts/emulator/beam/code_ix.c
index def7e164e2..9158d2d05c 100644
--- a/erts/emulator/beam/code_ix.c
+++ b/erts/emulator/beam/code_ix.c
@@ -75,7 +75,7 @@ void erts_end_staging_code_ix(void)
CIX_TRACE("end");
}
-void erts_activate_staging_code_ix(void)
+void erts_commit_staging_code_ix(void)
{
ErtsCodeIndex ix;
/* We need to this lock as we are now making the staging export table active */
@@ -98,14 +98,14 @@ void erts_abort_staging_code_ix(void)
}
-/* Try lock code_ix
+/*
* Calller _must_ yield if we return 0
*/
-int erts_try_lock_code_ix(Process* c_p)
+int erts_try_seize_code_write_permission(Process* c_p)
{
int success;
- ASSERT(!erts_smp_thr_progress_is_blocking());
+ ASSERT(!erts_smp_thr_progress_is_blocking()); /* to avoid deadlock */
erts_smp_mtx_lock(&the_code_ix_queue_lock);
success = !the_code_ix_lock;
@@ -125,9 +125,7 @@ int erts_try_lock_code_ix(Process* c_p)
return success;
}
-/* Unlock code_ix (resume all waiters)
-*/
-void erts_unlock_code_ix(void)
+void erts_release_code_write_permission(void)
{
erts_smp_mtx_lock(&the_code_ix_queue_lock);
while (the_code_ix_queue != NULL) { /* unleash the entire herd */