source: valtobtest/subversion-1.6.2/subversion/bindings/javahl/native/Pool.cpp @ 3

Last change on this file since 3 was 3, checked in by valtob, 15 years ago

subversion source 1.6.2 as test

File size: 1.5 KB
Line 
1/**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2003-2007 CollabNet.  All rights reserved.
5 *
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution.  The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
11 *
12 * This software consists of voluntary contributions made by many
13 * individuals.  For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
17 *
18 * @file Pool.cpp
19 * @brief Implementation of the class Pool
20 */
21
22#include "Pool.h"
23#include "JNIUtil.h"
24#include "JNIMutex.h"
25#include "JNICriticalSection.h"
26#include "svn_pools.h"
27
28/**
29 * Constructor to create one apr pool as the subpool of the global pool
30 * store this pool as the request pool.
31 */
32Pool::Pool()
33{
34  JNICriticalSection criticalSection(*JNIUtil::getGlobalPoolMutex());
35  m_pool = svn_pool_create(JNIUtil::getPool());
36  JNIUtil::setRequestPool(this);
37}
38
39/**
40 * Destructor to destroy the apr pool and to clear the request pool
41 * pointer.
42 */
43Pool::~Pool()
44{
45  JNICriticalSection criticalSection(*JNIUtil::getGlobalPoolMutex());
46  JNIUtil::setRequestPool(NULL);
47  if (m_pool)
48    svn_pool_destroy(m_pool);
49}
Note: See TracBrowser for help on using the repository browser.