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
9c8844fd
Commit
9c8844fd
authored
Aug 25, 2017
by
Constantin Rack
Committed by
GitHub
Aug 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2719 from jimklimov/setThreadName
Problem: cosmetic setThreadName() can be fatal
parents
5c981be9
40a3b074
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
thread.cpp
src/thread.cpp
+10
-3
No files found.
src/thread.cpp
View file @
9c8844fd
...
...
@@ -167,18 +167,25 @@ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_
void
zmq
::
thread_t
::
setThreadName
(
const
char
*
name_
)
{
/* The thread name is a cosmetic string, added to ease debugging of
* multi-threaded applications. It is not a big issue if this value
* can not be set for any reason (such as Permission denied in some
* cases where the application changes its EUID, etc.) The value of
* "int rc" is retained where available, to help debuggers stepping
* through code to see its value - but otherwise it is ignored.
*/
if
(
!
name_
)
return
;
#if defined(ZMQ_HAVE_PTHREAD_SETNAME_1)
int
rc
=
pthread_setname_np
(
name_
);
posix_assert
(
rc
)
;
if
(
rc
)
return
;
#elif defined(ZMQ_HAVE_PTHREAD_SETNAME_2)
int
rc
=
pthread_setname_np
(
descriptor
,
name_
);
posix_assert
(
rc
)
;
if
(
rc
)
return
;
#elif defined(ZMQ_HAVE_PTHREAD_SETNAME_3)
int
rc
=
pthread_setname_np
(
descriptor
,
name_
,
NULL
);
posix_assert
(
rc
)
;
if
(
rc
)
return
;
#elif defined(ZMQ_HAVE_PTHREAD_SET_NAME)
pthread_set_name_np
(
descriptor
,
name_
);
#endif
...
...
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