3 * Copyright (c) 1998-2002
6 * Permission to use, copy, modify, distribute and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appear in all copies and
9 * that both that copyright notice and this permission notice appear
10 * in supporting documentation. Dr John Maddock makes no representations
11 * about the suitability of this software for any purpose.
12 * It is provided "as is" without express or implied warranty.
17 * LOCATION: see http://www.boost.org for most recent version.
18 * FILE: regex_synch.cpp
19 * VERSION: see <boost/version.hpp>
20 * DESCRIPTION: Thread synch helper functions, for regular
25 #define BOOST_REGEX_SOURCE
27 #include <boost/regex/detail/regex_synch.hpp>
32 void BOOST_REGEX_CALL re_init_threads()
35 #ifdef BOOST_HAS_THREADS
37 p_re_lock = new critical_section();
38 cs_guard g(*p_re_lock);
43 void BOOST_REGEX_CALL re_free_threads()
46 #ifdef BOOST_HAS_THREADS
47 cs_guard g(*p_re_lock);
49 if(re_lock_count == 0)
58 #ifdef BOOST_HAS_THREADS
60 BOOST_REGEX_DECL critical_section* p_re_lock = 0;
62 BOOST_REGEX_DECL unsigned int re_lock_count = 0;
66 } // namespace re_detail