svn commit: samba r19666 - in branches/SAMBA_3_0/source/lib/talloc:
.
vlendec at samba.org
vlendec at samba.org
Sat Nov 11 17:02:08 GMT 2006
Author: vlendec
Date: 2006-11-11 17:02:08 +0000 (Sat, 11 Nov 2006)
New Revision: 19666
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19666
Log:
Talloc_guide text on multithreading by Remi Turboult
Modified:
branches/SAMBA_3_0/source/lib/talloc/talloc_guide.txt
Changeset:
Modified: branches/SAMBA_3_0/source/lib/talloc/talloc_guide.txt
===================================================================
--- branches/SAMBA_3_0/source/lib/talloc/talloc_guide.txt 2006-11-11 16:50:38 UTC (rev 19665)
+++ branches/SAMBA_3_0/source/lib/talloc/talloc_guide.txt 2006-11-11 17:02:08 UTC (rev 19666)
@@ -56,7 +56,23 @@
The following is a complete guide to the talloc API. Read it all at
least twice.
+Multi-threading
+---------------
+talloc itself does not deal with threads. It is thread-safe (assuming
+the underlying "malloc" is), as long as each thread uses different
+memory contexts.
+If two threads uses the same context then they need to synchronize in
+order to be safe. In particular:
+- when using talloc_enable_leak_report(), giving directly NULL as a
+parent context implicitly refers to a hidden "null context" global
+variable, so this should not be used in a multi-threaded environment
+without proper synchronization ;
+- the context returned by talloc_autofree_context() is also global so
+shouldn't be used by several threads simultaneously without
+synchronization.
+
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
(type *)talloc(const void *context, type);
More information about the samba-cvs
mailing list