summaryrefslogtreecommitdiff
path: root/ACE/ace/Reverse_Lock_T.cpp
blob: eac8be2976b1d8f076c6e6ecb57e4c130f9ec254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef ACE_REVERSE_LOCK_T_CPP
#define ACE_REVERSE_LOCK_T_CPP

#include "ace/Reverse_Lock_T.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if !defined (__ACE_INLINE__)
#include "ace/Reverse_Lock_T.inl"
#endif /* __ACE_INLINE__ */

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

template <class ACE_LOCKING_MECHANISM>
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::~ACE_Reverse_Lock ()
{
}

// Explicitly destroy the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::remove ()
{
  return this->lock_.remove ();
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire ()
{
  return this->lock_.release ();
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire ()
{
  ACE_NOTSUP_RETURN (-1);
}

// Acquire the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::release ()
{
  if (this->acquire_method_ == ACE_Acquire_Method::ACE_READ)
    return this->lock_.acquire_read ();
  else if (this->acquire_method_ == ACE_Acquire_Method::ACE_WRITE)
    return this->lock_.acquire_write ();
  else
    return this->lock_.acquire ();
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_read ()
{
  ACE_NOTSUP_RETURN (-1);
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::acquire_write ()
{
  ACE_NOTSUP_RETURN (-1);
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_read ()
{
  ACE_NOTSUP_RETURN (-1);
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write ()
{
  ACE_NOTSUP_RETURN (-1);
}

// Release the lock.
template <class ACE_LOCKING_MECHANISM> int
ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire_write_upgrade ()
{
  ACE_NOTSUP_RETURN (-1);
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_REVERSE_LOCK_T_CPP */