From f2b9bf3f35526ed4a5d6c359be1cb1293cacafdf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Feb 2010 11:56:29 +0200 Subject: Lock the grammar pool in the example --- examples/cxx/tree/embedded/driver.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples/cxx') diff --git a/examples/cxx/tree/embedded/driver.cxx b/examples/cxx/tree/embedded/driver.cxx index 3c49702..6e31d3b 100644 --- a/examples/cxx/tree/embedded/driver.cxx +++ b/examples/cxx/tree/embedded/driver.cxx @@ -71,6 +71,14 @@ main (int argc, char* argv[]) return 1; } + // Lock the grammar pool. This is necessary if we plan to use the + // same grammar pool in multiple threads (this way we can reuse the + // same grammar in multiple parsers). Locking the pool disallows any + // modifications to the pool, such as an attempt by one of the threads + // to cache additional schemas. + // + gp->lockPool (); + // Get an implementation of the Load-Store (LS) interface. // const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull}; -- cgit v1.1