\ No newline at end of file
diff --git a/thread-local-storage/Thread_local_storage/index.html b/thread-local-storage/Thread_local_storage/index.html
new file mode 100644
index 0000000..558034e
--- /dev/null
+++ b/thread-local-storage/Thread_local_storage/index.html
@@ -0,0 +1,2 @@
+
+Thread_local_storage (thread-local-storage.Thread_local_storage)
Module Thread_local_storage
Thread local storage
type'a t
A TLS slot for values of type 'a. This allows the storage of a single value of type 'a per thread.
Allocate a new TLS slot. The TLS slot starts uninitialised on each thread.
Note: each TLS slot allocated consumes a word per thread, and it can never be deallocated. create should be called at toplevel to produce constants, do not use it in a loop.
raisesFailure
if no more TLS slots can be allocated.
exceptionNot_set
Exception raised when accessing a slot that was not previously set on this thread
if the TLS slot has not been initialised in the current thread. Do note that this uses raise_notrace for performance reasons, so make sure to always catch the exception as it will not carry a backtrace.
get_opt x returns Some v where v is the value previously stored in the TLS slot x for the current thread. It returns None if the TLS slot has not been initialised in the current thread.
This function is safe to use from asynchronous callbacks without risks of races.
get_default x ~default returns the value previously stored in the TLS slot x for the current thread. If the TLS slot has not been initialised, default () is called, and its result is returned instead, after being stored in the TLS slot x.
If the call to default () raises an exception, then the TLS slot remains uninitialised. If default is a function that always raises, then this function is safe to use from asynchronous callbacks without risks of races.
diff --git a/thread-local-storage/_doc-dir/CHANGES.md b/thread-local-storage/_doc-dir/CHANGES.md
new file mode 100644
index 0000000..91e239a
--- /dev/null
+++ b/thread-local-storage/_doc-dir/CHANGES.md
@@ -0,0 +1,11 @@
+
+# 0.2
+
+- Incompatible API change, making things simpler.
+- It is now safe to read TLS from asynchronous callbacks (e.g. memprof
+ callbacks).
+
+# 0.1
+
+initial release
+
diff --git a/thread-local-storage/_doc-dir/LICENSE b/thread-local-storage/_doc-dir/LICENSE
new file mode 100644
index 0000000..11be746
--- /dev/null
+++ b/thread-local-storage/_doc-dir/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Simon Cruanes
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/thread-local-storage/_doc-dir/README.md b/thread-local-storage/_doc-dir/README.md
new file mode 100644
index 0000000..ff9ad24
--- /dev/null
+++ b/thread-local-storage/_doc-dir/README.md
@@ -0,0 +1,10 @@
+# Thread-local storage
+
+The classic threading utility: have variables that have a value for each thread.
+
+See https://discuss.ocaml.org/t/a-hack-to-implement-efficient-tls-thread-local-storage/13264 for the initial implementation
+by @polytypic.
+
+## License
+
+MIT
diff --git a/thread-local-storage/index.html b/thread-local-storage/index.html
new file mode 100644
index 0000000..b5e621f
--- /dev/null
+++ b/thread-local-storage/index.html
@@ -0,0 +1,2 @@
+
+index (thread-local-storage.index)