aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/code_ix.h
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/code_ix.h')
-rw-r--r--erts/emulator/beam/code_ix.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/erts/emulator/beam/code_ix.h b/erts/emulator/beam/code_ix.h
index 99fd4ec348..66543fa2a8 100644
--- a/erts/emulator/beam/code_ix.h
+++ b/erts/emulator/beam/code_ix.h
@@ -55,10 +55,13 @@
# endif
# include "sys.h"
#endif
+struct process;
+
#define ERTS_NUM_CODE_IX 3
typedef unsigned ErtsCodeIndex;
+
/* Called once at emulator initialization.
*/
void erts_code_ix_init(void);
@@ -78,14 +81,13 @@ ErtsCodeIndex erts_active_code_ix(void);
ERTS_GLB_INLINE
ErtsCodeIndex erts_staging_code_ix(void);
-/* Lock code_ix.
- * Gives (exclusive) access to the staging area and write access to active code index.
- * ToDo: Waiting process should be queued and return to be suspended.
+/* Try lock code_ix that is needed for (exlusive) access of the staging area.
+ * Main process lock (only) must be held.
+ * Caller is suspended and *must* yield if 0 is returned.
*/
-void erts_lock_code_ix(void);
+int erts_try_lock_code_ix(struct process*);
/* Unlock code_ix
- * ToDo: Dequeue and resume waiting processes.
*/
void erts_unlock_code_ix(void);