~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to include/libtorrent/asio/detail/local_free_on_block_exit.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// local_free_on_block_exit.hpp
3
 
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
 
//
5
 
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6
 
//
7
 
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
 
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
 
//
10
 
 
11
 
#ifndef ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP
12
 
#define ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP
13
 
 
14
 
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15
 
# pragma once
16
 
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
 
 
18
 
#include "asio/detail/push_options.hpp"
19
 
 
20
 
#include "asio/detail/push_options.hpp"
21
 
#include <boost/config.hpp>
22
 
#include "asio/detail/pop_options.hpp"
23
 
 
24
 
#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
25
 
 
26
 
#include "asio/detail/noncopyable.hpp"
27
 
#include "asio/detail/socket_types.hpp"
28
 
 
29
 
namespace asio {
30
 
namespace detail {
31
 
 
32
 
class local_free_on_block_exit
33
 
  : private noncopyable
34
 
{
35
 
public:
36
 
  // Constructor blocks all signals for the calling thread.
37
 
  explicit local_free_on_block_exit(void* p)
38
 
    : p_(p)
39
 
  {
40
 
  }
41
 
 
42
 
  // Destructor restores the previous signal mask.
43
 
  ~local_free_on_block_exit()
44
 
  {
45
 
    ::LocalFree(p_);
46
 
  }
47
 
 
48
 
private:
49
 
  void* p_;
50
 
};
51
 
 
52
 
} // namespace detail
53
 
} // namespace asio
54
 
 
55
 
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
56
 
 
57
 
#include "asio/detail/pop_options.hpp"
58
 
 
59
 
#endif // ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP