Definition at line 39 of file stevtserver.cc.
◆ EvtBuffer()
Definition at line 42 of file stevtserver.cc.
43 {
44 m_id = id;
45 m_evtbuf = new int[NWORD_BUFFER];
46 m_writable = true;
47 m_readable = false;
48 }
◆ buffer()
Definition at line 75 of file stevtserver.cc.
76 {
77 m_writable = false;
78 m_readable = true;
79 return m_evtbuf;
80 }
◆ lock()
◆ read()
Definition at line 81 of file stevtserver.cc.
82 {
83 m_mutex.lock();
84 while (true) {
85 if (!m_readable) {
86 m_cond.wait(m_mutex);
87 } else {
88
89
90 writer.write(m_evtbuf, m_evtbuf[0] * 4);
91 m_writable = true;
92 m_readable = false;
93 g_mutex.lock();
94 g_cond.signal();
95 g_mutex.unlock();
96 break;
97 }
98 }
99 m_mutex.unlock();
100 }
◆ signal()
◆ unlock()
◆ writable()
Definition at line 65 of file stevtserver.cc.
66 {
67 m_mutex.lock();
68 bool succeded = false;
69 if (m_writable) {
70 succeded = true;
71 }
72 m_mutex.unlock();
73 return succeded;
74 }
◆ write()
bool write |
( |
int * |
buf, |
|
|
int |
nbyte |
|
) |
| |
|
inline |
Definition at line 51 of file stevtserver.cc.
52 {
53 m_mutex.lock();
54 bool succeded = false;
55 if (m_writable) {
56 memcpy(m_evtbuf, buf, nbyte);
57 m_cond.signal();
58 m_writable = false;
59 m_readable = true;
60 succeded = true;
61 }
62 m_mutex.unlock();
63 return succeded;
64 }
◆ m_cond
◆ m_evtbuf
◆ m_id
◆ m_mutex
◆ m_readable
◆ m_writable
The documentation for this class was generated from the following file: