Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qjs-wrapper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
qjs-wrapper
Commits
671da487
Commit
671da487
authored
Sep 30, 2022
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for Pub/Sub server to stop before returning
parent
c9acd773
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
qjs_wrapper.c
qjs_wrapper.c
+8
-4
No files found.
qjs_wrapper.c
View file @
671da487
...
...
@@ -3,7 +3,8 @@
static
JSClassID
jsDroneClassId
;
static
UA_Boolean
pubsubRunning
=
true
;
static
UA_Boolean
pubsubShouldRun
=
true
;
static
UA_Boolean
pubsubExited
=
false
;
static
UA_UInt32
nbDrone
;
static
JSValueConst
*
droneObjectIdList
;
...
...
@@ -340,13 +341,14 @@ static JSValue js_run_pubsub(JSContext *ctx, JSValueConst this_val,
droneVariableArray
,
countof
(
droneVariableArray
),
id
,
nbDrone
,
interval
,
init_node_id
,
get_drone_id
,
pubsub_get_value
,
pubsub_update_coordinates
,
&
pubsub
Running
);
&
pubsub
ShouldRun
);
}
else
{
res
=
subscribeOnly
(
&
transportProfile
,
&
networkAddressUrl
,
droneVariableArray
,
countof
(
droneVariableArray
),
id
,
nbDrone
,
interval
,
init_node_id
,
get_drone_id
,
pubsub_print_coordinates
,
&
pubsub
Running
);
pubsub_print_coordinates
,
&
pubsub
ShouldRun
);
}
pubsubExited
=
true
;
JS_FreeCString
(
ctx
,
ipv6
);
JS_FreeCString
(
ctx
,
port
);
...
...
@@ -370,7 +372,9 @@ static JSValue js_stop_pubsub(JSContext *ctx, JSValueConst thisVal,
{
struct
messageNode
*
current
;
pubsubRunning
=
false
;
pubsubShouldRun
=
false
;
while
(
!
pubsubExited
)
sleep
(
1
);
free
(
droneObjectIdList
);
while
(
messageQueue
.
head
!=
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