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
28dc1b1c
Commit
28dc1b1c
authored
5 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] optimise Db.yield a bit
parent
b237c7ee
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/db.ml
+24
-11
24 additions, 11 deletions
src/kernel_services/plugin_entry_points/db.ml
with
24 additions
and
11 deletions
src/kernel_services/plugin_entry_points/db.ml
+
24
−
11
View file @
28dc1b1c
...
@@ -1092,18 +1092,31 @@ let with_progress ?debounced trigger job data =
...
@@ -1092,18 +1092,31 @@ let with_progress ?debounced trigger job data =
with
exn
->
with
exn
->
off_progress
d
;
trigger
()
;
raise
exn
off_progress
d
;
trigger
()
;
raise
exn
let
yield_once
()
=
match
!
pending
with
|
[]
->
()
|
rjobs
->
pending
:=
[]
;
List
.
iter
(
fun
f
->
f
()
)
(
List
.
rev
rjobs
)
let
yield_daemons
()
=
match
!
daemons
with
|
[]
->
()
|
ds
->
let
t
=
Unix
.
gettimeofday
()
in
List
.
iter
(
fun
d
->
if
t
>
d
.
next_at
then
begin
d
.
next_at
<-
t
+.
d
.
debounced
;
d
.
trigger
()
;
end
)
ds
let
yield
()
=
let
yield
()
=
let
jobs
=
List
.
rev
!
pending
in
begin
pending
:=
[]
;
yield_once
()
;
List
.
iter
(
fun
f
->
f
()
)
jobs
;
yield_daemons
()
;
let
t
=
Unix
.
gettimeofday
()
in
end
List
.
iter
(
fun
d
->
if
t
>
d
.
next_at
then
begin
d
.
next_at
<-
t
+.
d
.
debounced
;
d
.
trigger
()
;
end
)
!
daemons
let
flush
()
=
let
flush
()
=
List
.
iter
(
fun
d
->
d
.
next_at
<-
0
.
0
)
!
daemons
;
List
.
iter
(
fun
d
->
d
.
next_at
<-
0
.
0
)
!
daemons
;
...
...
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