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
a0a60e80
Commit
a0a60e80
authored
May 28, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: Magic number "2" in ctx.cpp
Solution: introduced constant
parent
bbc90388
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
ctx.cpp
src/ctx.cpp
+6
-5
No files found.
src/ctx.cpp
View file @
a0a60e80
...
...
@@ -283,13 +283,14 @@ int zmq::ctx_t::get (int option_)
bool
zmq
::
ctx_t
::
start
()
{
// Initialise the array of mailboxes. Additional t
hree
slots are for
// Initialise the array of mailboxes. Additional t
wo
slots are for
// zmq_ctx_term thread and reaper thread.
_opt_sync
.
lock
();
int
mazmq
=
_max_sockets
;
int
ios
=
_io_thread_count
;
const
int
term_and_reaper_threads_count
=
2
;
const
int
mazmq
=
_max_sockets
;
const
int
ios
=
_io_thread_count
;
_opt_sync
.
unlock
();
_slot_count
=
mazmq
+
ios
+
2
;
_slot_count
=
mazmq
+
ios
+
term_and_reaper_threads_count
;
_slots
=
static_cast
<
i_mailbox
**>
(
malloc
(
sizeof
(
i_mailbox
*
)
*
_slot_count
));
if
(
!
_slots
)
{
...
...
@@ -313,7 +314,7 @@ bool zmq::ctx_t::start ()
// Create I/O thread objects and launch them.
for
(
int32_t
i
=
static_cast
<
int32_t
>
(
_slot_count
)
-
1
;
i
>=
static_cast
<
int32_t
>
(
2
);
i
--
)
{
i
>=
static_cast
<
int32_t
>
(
term_and_reaper_threads_count
);
i
--
)
{
_slots
[
i
]
=
NULL
;
}
...
...
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