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
f9270e93
Commit
f9270e93
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] lock only log listeners on rec
parent
8a29480c
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/kernel_services/plugin_entry_points/log.ml
+13
-13
13 additions, 13 deletions
src/kernel_services/plugin_entry_points/log.ml
with
13 additions
and
13 deletions
src/kernel_services/plugin_entry_points/log.ml
+
13
−
13
View file @
f9270e93
...
@@ -419,17 +419,7 @@ let check_not_yet = ref (fun _evt -> false)
...
@@ -419,17 +419,7 @@ let check_not_yet = ref (fun _evt -> false)
(* --- Listeners --- *)
(* --- Listeners --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
let
firelock
=
ref
false
let
do_fire
e
f
=
f
e
let
do_fire
e
f
=
if
!
firelock
then
f
e
else
try
firelock
:=
true
;
f
e
;
firelock
:=
false
with
exn
->
firelock
:=
false
;
raise
exn
let
iter_kind
?
kind
f
ems
=
let
iter_kind
?
kind
f
ems
=
match
kind
with
match
kind
with
...
@@ -490,6 +480,8 @@ let logtransient channel text =
...
@@ -490,6 +480,8 @@ let logtransient channel text =
raise
e
raise
e
)
buffer
text
)
buffer
text
let
locked_listeners
=
ref
false
let
logwithfinal
finally
channel
let
logwithfinal
finally
channel
?
(
fire
=
true
)
(* fire channel listeners *)
?
(
fire
=
true
)
(* fire channel listeners *)
?
emitwith
(* additional emitter *)
?
emitwith
(* additional emitter *)
...
@@ -528,8 +520,16 @@ let logwithfinal finally channel
...
@@ -528,8 +520,16 @@ let logwithfinal finally channel
if
echo
&&
e
.
echo
then
if
echo
&&
e
.
echo
then
do_echo
channel
.
terminal
event
;
do_echo
channel
.
terminal
event
;
Extlib
.
may
(
do_fire
event
)
emitwith
;
Extlib
.
may
(
do_fire
event
)
emitwith
;
if
fire
&&
not
!
firelock
then
if
fire
&&
not
!
locked_listeners
then
List
.
iter
(
do_fire
event
)
e
.
listeners
;
begin
try
locked_listeners
:=
true
;
List
.
iter
(
do_fire
event
)
e
.
listeners
;
locked_listeners
:=
false
;
with
exn
->
locked_listeners
:=
false
;
raise
exn
end
;
Some
event
Some
event
end
end
else
None
else
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