Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
3f8e6c08
Commit
3f8e6c08
authored
Dec 05, 2016
by
Luca Boccassi
Committed by
GitHub
Dec 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2239 from loachfish/master
avoid crashing in the multi-thread operation for std::vector
parents
42c63368
52ebffd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
epoll.cpp
src/epoll.cpp
+4
-0
epoll.hpp
src/epoll.hpp
+4
-0
No files found.
src/epoll.cpp
View file @
3f8e6c08
...
...
@@ -92,7 +92,9 @@ void zmq::epoll_t::rm_fd (handle_t handle_)
int
rc
=
epoll_ctl
(
epoll_fd
,
EPOLL_CTL_DEL
,
pe
->
fd
,
&
pe
->
ev
);
errno_assert
(
rc
!=
-
1
);
pe
->
fd
=
retired_fd
;
retired_sync
.
lock
();
retired
.
push_back
(
pe
);
retired_sync
.
unlock
();
// Decrease the load metric of the thread.
adjust_load
(
-
1
);
...
...
@@ -180,10 +182,12 @@ void zmq::epoll_t::loop ()
}
// Destroy retired event sources.
retired_sync
.
lock
();
for
(
retired_t
::
iterator
it
=
retired
.
begin
();
it
!=
retired
.
end
();
++
it
)
{
LIBZMQ_DELETE
(
*
it
);
}
retired
.
clear
();
retired_sync
.
unlock
();
}
}
...
...
src/epoll.hpp
View file @
3f8e6c08
...
...
@@ -41,6 +41,7 @@
#include "fd.hpp"
#include "thread.hpp"
#include "poller_base.hpp"
#include "mutex.hpp"
namespace
zmq
{
...
...
@@ -102,6 +103,9 @@ namespace zmq
// Handle of the physical thread doing the I/O work.
thread_t
worker
;
// Synchronisation of retired event sources
mutex_t
retired_sync
;
epoll_t
(
const
epoll_t
&
);
const
epoll_t
&
operator
=
(
const
epoll_t
&
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment