+2009-02-11 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * thread-safety.txt: Improve the docs about image lock.
+
2009-02-11 Rodrigo Kumpera <rkumpera@novell.com>
* thread-safety.txt: Document the new image lock.
There are a lot of global data structures which can be protected by a 'simple' lock. Simple means:
- the lock protects only this data structure or it only protects the data structures in a given C module.
An example would be the appdomains list in domain.c
+ - the lock can span many modules, but it still protects access to a single resource or set of resources.
+ An example would be the image lock, which protects all data structures that belong to a given MonoImage.
- the lock is only held for a short amount of time, and no other lock is acquired inside this simple lock. Thus there is
no possibility of deadlock.
+ Simple locks include, at least, the following :
+ - the per-image lock acquired by using mono_image_(un)lock functions.
+
1.3.2 The class loader lock
---------------------------
Each appdomain has a lock which protects the per-domain data structures.
-1.3.4 The image lock
---------------------
-
-Each MonoImage has a lock which protects the per-image data structures and memory pool. This lock must only
-be held while manipulating such structures and no call to any function besides that should be made. In special,
-no other runtime lock should be acquired while holding an image lock.
-
-1.3.5 The locking hierarchy
+1.3.4 The locking hierarchy
---------------------------
It is useful to model locks by a locking hierarchy, which is a relation between locks, which is reflexive, transitive,