Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
25a7e2b1
Commit
25a7e2b1
authored
Aug 13, 2015
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it clear that yield and receive are not intended for multi threaded mode
Bug: 474748
parent
5deab80d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
MQTTClient.c
src/MQTTClient.c
+4
-2
MQTTClient.h
src/MQTTClient.h
+3
-2
No files found.
src/MQTTClient.c
View file @
25a7e2b1
...
...
@@ -28,6 +28,7 @@
* Ian Craggs - fix for bug 447672 - simultaneous access to socket structure
* Ian Craggs - fix for bug 459791 - deadlock in WaitForCompletion for bad client
* Ian Craggs - fix for bug 474905 - insufficient synchronization for subscribe, unsubscribe, connect
* Ian Craggs - make it clear that yield and receive are not intended for multi-threaded mode (bug 474748)
*******************************************************************************/
/**
...
...
@@ -1747,7 +1748,8 @@ int MQTTClient_receive(MQTTClient handle, char** topicName, int* topicLen, MQTTC
MQTTClients
*
m
=
handle
;
FUNC_ENTRY
;
if
(
m
==
NULL
||
m
->
c
==
NULL
)
if
(
m
==
NULL
||
m
->
c
==
NULL
||
running
)
/* receive is not meant to be called in a multi-thread environment */
{
rc
=
MQTTCLIENT_FAILURE
;
goto
exit
;
...
...
@@ -1801,7 +1803,7 @@ void MQTTClient_yield(void)
int
rc
=
0
;
FUNC_ENTRY
;
if
(
running
)
if
(
running
)
/* yield is not meant to be called in a multi-thread environment */
{
MQTTClient_sleep
(
timeout
);
goto
exit
;
...
...
src/MQTTClient.h
View file @
25a7e2b1
...
...
@@ -33,8 +33,9 @@
*
* Both libraries are designed to be sparing in the use of threads. So multiple client objects are
* handled by one or two threads, with a select call in Socket_getReadySocket(), used to determine
* when a socket has incoming data. MQTTClient is not safe to be called from multiple threads,
* whereas MQTTAsync is.
* when a socket has incoming data. This API is thread safe: functions may be called by multiple application
* threads, with the exception of ::MQTTClient_yield and ::MQTTClient_receive, which are intended
* for single threaded environments only.
*
* @endcond
* @cond MQTTClient_main
...
...
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