acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
single_lock.h
1#pragma once
2
3
4class CLASS_DECL_ACME single_lock
5{
6public:
7
8
9 const ::subparticle * m_psubparticleContext;
10 ::subparticle * m_psubparticleSynchronization;
11 bool m_bLocked;
12 ::task * m_ptask = nullptr;
13 const_char_pointer m_pszFile;
14 ::i32 m_iLine;
15
16
17 explicit single_lock(subparticle * psubparticleSynchronization, bool bInitialLock = false, const ::subparticle * psubparticleContext = nullptr, const_char_pointer pszFile = nullptr, ::i32 iLine = -1);
18 ~single_lock();
19
20
21 void _wait();
22 bool _wait(const class ::time& wait);
23 ::e_status wait();
24 ::e_status wait(const class ::time& wait);
25 void _lock();
26 bool lock(const class ::time & wait = ::time::infinity());
27 void unlock();
28 void unlock(::i32 lCount, ::i32 * lPrevCount = nullptr);
29 bool is_locked() const;
30 class ::time remaining_from_timeout() const;
31
32
33 void debug_on_lock();
34 void debug_on_unlock();
35
36
37};
38
39
40
41
42class CLASS_DECL_ACME _single_lock
43{
44public:
45
46
47 const ::subparticle * m_psubparticleContext;
48 ::subparticle * m_psubparticleSynchronization;
49 bool m_bLocked;
50 ::task * m_ptask = nullptr;
51 const_char_pointer m_pszFile;
52 ::i32 m_iLine;
53
54
55 explicit _single_lock(::subparticle * psubparticle, bool bInitialLock = false, const ::subparticle * psubparticleContext = nullptr, const_char_pointer pszFile = nullptr, ::i32 iLine = -1);
56 ~_single_lock();
57
58
59 void _wait();
60 bool _wait(const class time & timeWait);
61 void _lock();
62// bool lock();
63 void unlock();
64 void unlock(::i32 lCount, ::i32 * lPrevCount = nullptr);
65 bool is_locked() const;
66
67
68 void debug_on_lock();
69 void debug_on_unlock();
70
71
72};
73//
74//
75//namespace parallelization
76//{
77//
78//
79// CLASS_DECL_ACME void on_single_lock_lock(::subparticle *psubparticleSynchronization,
80// const ::subparticle *psubparticleContext, const_char_pointer pszFile,
81// ::i32 iLine);
82// CLASS_DECL_ACME void on_single_lock_unlock(::subparticle *psubparticleSynchronization);
83//
84//
85//} // namespace parallelization
86//
87
88
void _wait()
Definition single_lock.cpp:439
Definition e_status.h:30
Definition subparticle.h:78
Definition task.h:117
Definition aaa_time.h:13