| 90 | } |
| 91 | |
| 92 | void DisplayData::removeEvent(U32 index) { |
| 93 | if (index >= eventQueue.size()) { |
| 94 | return; |
| 95 | } |
| 96 | eventQueue.erase(eventQueue.begin()+index); |
| 97 | if (eventQueue.empty()) { |
| 98 | KProcessPtr process = this->process.lock(); |
| 99 | if (!process) { |
| 100 | return; |
| 101 | } |
| 102 | KFileDescriptorPtr fd = process->getFileDescriptor(this->clientFd); |
| 103 | if (fd && fd->kobject->type == KTYPE_UNIX_SOCKET) { |
| 104 | std::shared_ptr<KUnixSocketObject> s = std::dynamic_pointer_cast<KUnixSocketObject>(fd->kobject); |
| 105 | while (s->isReadReady()) { |
| 106 | U8 b; |
| 107 | if (s->readNative(&b, 1) != 1) { |
| 108 | break; |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | void DisplayData::unlockEvents() { |
| 116 | #ifdef BOXEDWINE_MULTI_THREADED |
no test coverage detected