Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / File_Lock.inl
blob768f63500e48d921aac6d18068b38e0058ef1625
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 ACE_INLINE int
5 ACE_File_Lock::acquire_read (short whence, ACE_OFF_T start, ACE_OFF_T len)
7 // ACE_TRACE ("ACE_File_Lock::acquire_read");
8   return ACE_OS::flock_rdlock (&this->lock_, whence, start, len);
11 ACE_INLINE int
12 ACE_File_Lock::tryacquire_read (short whence, ACE_OFF_T start, ACE_OFF_T len)
14 // ACE_TRACE ("ACE_File_Lock::tryacquire_read");
15   return ACE_OS::flock_tryrdlock (&this->lock_, whence, start, len);
18 ACE_INLINE int
19 ACE_File_Lock::tryacquire_write (short whence, ACE_OFF_T start, ACE_OFF_T len)
21 // ACE_TRACE ("ACE_File_Lock::tryacquire_write");
22   return ACE_OS::flock_trywrlock (&this->lock_, whence, start, len);
25 ACE_INLINE int
26 ACE_File_Lock::tryacquire_write_upgrade (short whence,
27                                          ACE_OFF_T start,
28                                          ACE_OFF_T len)
30 // ACE_TRACE ("ACE_File_Lock::tryacquire_write_upgrade");
31   return ACE_OS::flock_trywrlock (&this->lock_, whence, start, len);
34 ACE_INLINE int
35 ACE_File_Lock::tryacquire (short whence, ACE_OFF_T start, ACE_OFF_T len)
37 // ACE_TRACE ("ACE_File_Lock::tryacquire");
38   return this->tryacquire_write (whence, start, len);
41 ACE_INLINE int
42 ACE_File_Lock::acquire_write (short whence, ACE_OFF_T start, ACE_OFF_T len)
44 // ACE_TRACE ("ACE_File_Lock::acquire_write");
45   return ACE_OS::flock_wrlock (&this->lock_, whence, start, len);
48 ACE_INLINE int
49 ACE_File_Lock::acquire (short whence, ACE_OFF_T start, ACE_OFF_T len)
51 // ACE_TRACE ("ACE_File_Lock::acquire");
52   return this->acquire_write (whence, start, len);
55 ACE_INLINE int
56 ACE_File_Lock::release (short whence, ACE_OFF_T start, ACE_OFF_T len)
58 // ACE_TRACE ("ACE_File_Lock::release");
59   return ACE_OS::flock_unlock (&this->lock_, whence, start, len);
62 ACE_INLINE int
63 ACE_File_Lock::remove (bool unlink_file)
65 // ACE_TRACE ("ACE_File_Lock::remove");
67   int result = 0;
69   if (!this->removed_)
70     {
71       this->removed_ = true;
72       result = ACE_OS::flock_destroy (&this->lock_,
73                                       unlink_file);
74     }
75   return result;
78 ACE_INLINE ACE_HANDLE
79 ACE_File_Lock::get_handle () const
81 // ACE_TRACE ("ACE_File_Lock::get_handle");
82   return this->lock_.handle_;
85 ACE_INLINE void
86 ACE_File_Lock::set_handle (ACE_HANDLE h)
88 // ACE_TRACE ("ACE_File_Lock::set_handle");
89   this->lock_.handle_ = h;
90   this->removed_ = false;
93 ACE_END_VERSIONED_NAMESPACE_DECL