~armagetronad-dev/armagetronad/trunk-winlibs-work

« back to all changes in this revision

Viewing changes to boost/includes/boost/thread/win32/mutex.hpp

  • Committer: Manuel Moos
  • Date: 2011-08-25 10:46:34 UTC
  • Revision ID: manuel@moosnet.de-20110825104634-60a1qoe9tnpkc3ov
Adding boost::thread part 3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef BOOST_THREAD_WIN32_MUTEX_HPP
 
2
#define BOOST_THREAD_WIN32_MUTEX_HPP
 
3
// (C) Copyright 2005-7 Anthony Williams
 
4
// Distributed under the Boost Software License, Version 1.0. (See
 
5
// accompanying file LICENSE_1_0.txt or copy at
 
6
// http://www.boost.org/LICENSE_1_0.txt)
 
7
 
 
8
#include "basic_timed_mutex.hpp"
 
9
#include <boost/utility.hpp>
 
10
#include <boost/thread/exceptions.hpp>
 
11
#include <boost/thread/locks.hpp>
 
12
 
 
13
#include <boost/config/abi_prefix.hpp>
 
14
 
 
15
namespace boost
 
16
{
 
17
    namespace detail
 
18
    {
 
19
        typedef ::boost::detail::basic_timed_mutex underlying_mutex;
 
20
    }
 
21
 
 
22
    class mutex:
 
23
        public ::boost::detail::underlying_mutex
 
24
    {
 
25
    private:
 
26
        mutex(mutex const&);
 
27
        mutex& operator=(mutex const&);
 
28
    public:
 
29
        mutex()
 
30
        {
 
31
            initialize();
 
32
        }
 
33
        ~mutex()
 
34
        {
 
35
            destroy();
 
36
        }
 
37
 
 
38
        typedef unique_lock<mutex> scoped_lock;
 
39
        typedef detail::try_lock_wrapper<mutex> scoped_try_lock;
 
40
    };
 
41
 
 
42
    typedef mutex try_mutex;
 
43
 
 
44
    class timed_mutex:
 
45
        public ::boost::detail::basic_timed_mutex
 
46
    {
 
47
    private:
 
48
        timed_mutex(timed_mutex const&);
 
49
        timed_mutex& operator=(timed_mutex const&);
 
50
    public:
 
51
        timed_mutex()
 
52
        {
 
53
            initialize();
 
54
        }
 
55
 
 
56
        ~timed_mutex()
 
57
        {
 
58
            destroy();
 
59
        }
 
60
 
 
61
        typedef unique_lock<timed_mutex> scoped_timed_lock;
 
62
        typedef detail::try_lock_wrapper<timed_mutex> scoped_try_lock;
 
63
        typedef scoped_timed_lock scoped_lock;
 
64
    };
 
65
}
 
66
 
 
67
#include <boost/config/abi_suffix.hpp>
 
68
 
 
69
#endif