Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ Phil Hutchinson <phil@volumedia.co.uk>
Philipp Dallig <philipp.dallig@gmail.com>
Philipp Dorschner <philipp.dorschner@netways.de>
pv2b <pvz@pvz.pp.se>
qorexdevs <sanenkosana600@gmail.com>
Ralph Breier <ralph.breier@roedl.com>
Reto Zeder <reto.zeder@arcade.ch>
Ricardo Bartels <ricardo@bitchbrothers.com>
Expand Down
16 changes: 8 additions & 8 deletions lib/base/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,10 @@ bool Process::GetAdjustPriority() const
void Process::IOThreadProc(int tid)
{
#ifdef _WIN32
HANDLE *handles = nullptr;
HANDLE *fhandles = nullptr;
std::vector<HANDLE> handles;
std::vector<HANDLE> fhandles;
#else /* _WIN32 */
pollfd *pfds = nullptr;
std::vector<pollfd> pfds;
#endif /* _WIN32 */
int count = 0;
double now;
Expand All @@ -617,13 +617,13 @@ void Process::IOThreadProc(int tid)

count = 1 + l_Processes[tid].size();
#ifdef _WIN32
handles = reinterpret_cast<HANDLE *>(realloc(handles, sizeof(HANDLE) * count));
fhandles = reinterpret_cast<HANDLE *>(realloc(fhandles, sizeof(HANDLE) * count));
handles.resize(count);
fhandles.resize(count);

fhandles[0] = l_Events[tid];

#else /* _WIN32 */
pfds = reinterpret_cast<pollfd *>(realloc(pfds, sizeof(pollfd) * count));
pfds.resize(count);

pfds[0].fd = l_EventFDs[tid][0];
pfds[0].events = POLLIN;
Expand Down Expand Up @@ -670,9 +670,9 @@ void Process::IOThreadProc(int tid)
timeout *= 1000;

#ifdef _WIN32
DWORD rc = WaitForMultipleObjects(count, fhandles, FALSE, timeout == -1 ? INFINITE : static_cast<DWORD>(timeout));
DWORD rc = WaitForMultipleObjects(count, fhandles.data(), FALSE, timeout == -1 ? INFINITE : static_cast<DWORD>(timeout));
#else /* _WIN32 */
int rc = poll(pfds, count, timeout);
int rc = poll(pfds.data(), count, timeout);

if (rc < 0)
continue;
Expand Down