summaryrefslogtreecommitdiff
path: root/ace/Token.i
blob: 44e7b506f5fda72788bdba71bc704833943cae33 (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
/* -*- C++ -*- */
// $Id$

// Token.i

ACE_INLINE int
ACE_Token::remove (void)
{
  ACE_TRACE ("ACE_Token::remove");
  // Don't have an implementation for this yet...
  ACE_NOTSUP_RETURN (-1);
}

ACE_INLINE int 
ACE_Token::tryacquire (void)
{
  ACE_TRACE ("ACE_Token::tryacquire");
  return this->shared_acquire 
    (0, 0, (ACE_Time_Value *) &ACE_Time_Value::zero);
}

ACE_INLINE int 
ACE_Token::waiters (void)
{
  ACE_TRACE ("ACE_Token::waiters");
  ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);

  int ret = this->waiters_;
  return ret;
}

ACE_INLINE ACE_thread_t 
ACE_Token::current_owner (void)
{
  ACE_TRACE ("ACE_Token::current_owner");
  ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, this->owner_);

  return this->owner_;
}

ACE_INLINE int
ACE_Token::acquire_read (void)
{
  ACE_TRACE ("ACE_Token::acquire_read");
  return this->acquire ();
}

ACE_INLINE int
ACE_Token::acquire_write (void)
{
  ACE_TRACE ("ACE_Token::acquire_write");
  return this->acquire ();
}

ACE_INLINE int
ACE_Token::tryacquire_read (void)
{
  ACE_TRACE ("ACE_Token::tryacquire_read");
  return this->tryacquire ();
}

ACE_INLINE int
ACE_Token::tryacquire_write (void)
{
  ACE_TRACE ("ACE_Token::tryacquire_write");
  return this->tryacquire ();
}