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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2008-07-02 10:46:21 UTC
  • Revision ID: james.westby@ubuntu.com-20080702104621-jzx3pfke9lkcxfxn
Tags: upstream-0.13.1
ImportĀ upstreamĀ versionĀ 0.13.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// null_mutex.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_NULL_MUTEX_HPP
 
12
#define ASIO_DETAIL_NULL_MUTEX_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_HAS_THREADS)
 
25
 
 
26
#include "asio/detail/noncopyable.hpp"
 
27
#include "asio/detail/scoped_lock.hpp"
 
28
 
 
29
namespace asio {
 
30
namespace detail {
 
31
 
 
32
class null_mutex
 
33
  : private noncopyable
 
34
{
 
35
public:
 
36
  typedef asio::detail::scoped_lock<null_mutex> scoped_lock;
 
37
 
 
38
  // Constructor.
 
39
  null_mutex()
 
40
  {
 
41
  }
 
42
 
 
43
  // Destructor.
 
44
  ~null_mutex()
 
45
  {
 
46
  }
 
47
 
 
48
  // Lock the mutex.
 
49
  void lock()
 
50
  {
 
51
  }
 
52
 
 
53
  // Unlock the mutex.
 
54
  void unlock()
 
55
  {
 
56
  }
 
57
};
 
58
 
 
59
} // namespace detail
 
60
} // namespace asio
 
61
 
 
62
#endif // !defined(BOOST_HAS_THREADS)
 
63
 
 
64
#include "asio/detail/pop_options.hpp"
 
65
 
 
66
#endif // ASIO_DETAIL_NULL_MUTEX_HPP