Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
44f0e1f1
Commit
44f0e1f1
authored
3 years ago
by
Loïc Correnson
Committed by
David Bühler
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[server] signaling cmdline once ; replies order
parent
d59d58d8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/server/main.ml
+11
-2
11 additions, 2 deletions
src/plugins/server/main.ml
with
11 additions
and
2 deletions
src/plugins/server/main.ml
+
11
−
2
View file @
44f0e1f1
...
@@ -108,6 +108,7 @@ type 'a server = {
...
@@ -108,6 +108,7 @@ type 'a server = {
mutable
s_signal
:
Signals
.
t
;
(* emitted signals since last synchro *)
mutable
s_signal
:
Signals
.
t
;
(* emitted signals since last synchro *)
mutable
shutdown
:
bool
;
(* server has been asked to shut down *)
mutable
shutdown
:
bool
;
(* server has been asked to shut down *)
mutable
running
:
'
a
running
;
(* server running state *)
mutable
running
:
'
a
running
;
(* server running state *)
mutable
cmdline
:
bool
option
;
(* cmdline signal management *)
}
}
exception
Killed
exception
Killed
...
@@ -296,7 +297,13 @@ let communicate server =
...
@@ -296,7 +297,13 @@ let communicate server =
with
exn
->
Some
exn
in
(* re-raised after message reply *)
with
exn
->
Some
exn
in
(* re-raised after message reply *)
let
pool
=
ref
[]
in
let
pool
=
ref
[]
in
Queue
.
iter
(
fun
r
->
pool
:=
r
::
!
pool
)
server
.
q_out
;
Queue
.
iter
(
fun
r
->
pool
:=
r
::
!
pool
)
server
.
q_out
;
Option
.
iter
(
fun
cmd
->
pool
:=
(
if
cmd
then
`CmdLineOn
else
`CmdLineOff
)
::
!
pool
;
)
server
.
cmdline
;
pool
:=
List
.
rev
!
pool
;
Queue
.
clear
server
.
q_out
;
Queue
.
clear
server
.
q_out
;
server
.
cmdline
<-
None
;
server
.
s_signal
<-
Signals
.
empty
;
server
.
s_signal
<-
Signals
.
empty
;
Senv
.
debug
~
level
:
2
"response(s) callback"
;
Senv
.
debug
~
level
:
2
"response(s) callback"
;
if
Senv
.
debug_atleast
2
then
if
Senv
.
debug_atleast
2
then
...
@@ -366,6 +373,7 @@ let create ~pretty ?(equal=(=)) ~fetch () =
...
@@ -366,6 +373,7 @@ let create ~pretty ?(equal=(=)) ~fetch () =
s_signal
=
Signals
.
empty
;
s_signal
=
Signals
.
empty
;
daemon
=
None
;
daemon
=
None
;
running
=
Idle
;
running
=
Idle
;
cmdline
=
None
;
shutdown
=
false
;
shutdown
=
false
;
}
}
...
@@ -379,7 +387,7 @@ let start server =
...
@@ -379,7 +387,7 @@ let start server =
Senv
.
debug
~
level
:
2
"Server started (was %a)"
Senv
.
debug
~
level
:
2
"Server started (was %a)"
(
pp_running
server
.
pretty
)
server
.
running
;
(
pp_running
server
.
pretty
)
server
.
running
;
server
.
running
<-
CmdLine
;
server
.
running
<-
CmdLine
;
Queue
.
push
`C
md
L
ine
On
server
.
q_out
;
server
.
c
md
l
ine
<-
Some
true
;
emitter
:=
do_signal
server
;
emitter
:=
do_signal
server
;
match
server
.
daemon
with
match
server
.
daemon
with
|
Some
_
->
()
|
Some
_
->
()
...
@@ -411,6 +419,7 @@ let stop server =
...
@@ -411,6 +419,7 @@ let stop server =
Senv
.
feedback
"Server disabled."
;
Senv
.
feedback
"Server disabled."
;
server
.
daemon
<-
None
;
server
.
daemon
<-
None
;
server
.
running
<-
Idle
;
server
.
running
<-
Idle
;
server
.
cmdline
<-
None
;
Db
.
off_progress
daemon
;
Db
.
off_progress
daemon
;
set_active
false
;
set_active
false
;
end
end
...
@@ -422,7 +431,7 @@ let foreground server =
...
@@ -422,7 +431,7 @@ let foreground server =
Senv
.
debug
~
level
:
2
"Server foreground (was %a)"
Senv
.
debug
~
level
:
2
"Server foreground (was %a)"
(
pp_running
server
.
pretty
)
server
.
running
;
(
pp_running
server
.
pretty
)
server
.
running
;
server
.
running
<-
Idle
;
server
.
running
<-
Idle
;
Queue
.
push
`C
md
L
ine
Off
server
.
q_out
;
server
.
c
md
l
ine
<-
Some
false
;
emitter
:=
do_signal
server
;
emitter
:=
do_signal
server
;
match
server
.
daemon
with
match
server
.
daemon
with
|
None
->
()
|
None
->
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment