summaryrefslogtreecommitdiff
path: root/docs/type_system/shared.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/type_system/shared.md')
-rw-r--r--docs/type_system/shared.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/type_system/shared.md b/docs/type_system/shared.md
new file mode 100644
index 0000000..db8e6dc
--- /dev/null
+++ b/docs/type_system/shared.md
@@ -0,0 +1,27 @@
+# Shared
+
+---
+
+Hold multiple references to the same object
+
+```text
+Shared[[LOCK] Type]
+```
+
+### `LOCK`
+
+The shared type has been detected across asynchronous tasks and needs to lock the mutex on mutation
+
+# Garbage Collection
+
+A tracing mark and sweep garbage collector is used
+
+# Mutating
+
+```text
+x : Shared[Array] $ (1; 2; 3)
+^ x {[y]
+ y `push 4
+}
+`log x // Shared[Array[I64]] $ (1; 2; 3; 4)
+```