Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Verlässliche Systemsoftware
projects
osv
Commits
a731ffc1
Commit
a731ffc1
authored
12 years ago
by
Avi Kivity
Browse files
Options
Downloads
Patches
Plain Diff
sched: rearrange declaration order
No functional changes - prepare for making timer lists cpu local.
parent
60085619
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/sched.hh
+26
-26
26 additions, 26 deletions
include/sched.hh
with
26 additions
and
26 deletions
include/sched.hh
+
26
−
26
View file @
a731ffc1
...
...
@@ -22,6 +22,8 @@ namespace sched {
class
thread
;
class
cpu
;
class
timer
;
class
timer_list
;
void
schedule
(
bool
yield
=
false
);
...
...
@@ -31,6 +33,21 @@ extern "C" {
namespace
bi
=
boost
::
intrusive
;
class
timer
:
public
bi
::
set_base_hook
<>
{
public:
explicit
timer
(
thread
&
t
);
~
timer
();
void
set
(
u64
time
);
bool
expired
()
const
;
void
cancel
();
friend
bool
operator
<
(
const
timer
&
t1
,
const
timer
&
t2
);
private:
thread
&
_t
;
bool
_expired
;
u64
_time
;
friend
class
timer_list
;
};
class
thread
{
public:
struct
stack_info
{
...
...
@@ -86,6 +103,15 @@ public:
bi
::
list_member_hook
<>
_thread_list_link
;
};
class
timer_list
:
private
clock_event_callback
{
public:
timer_list
();
virtual
void
fired
();
private:
friend
class
timer
;
bi
::
set
<
timer
,
bi
::
base_hook
<
bi
::
set_base_hook
<>>>
_list
;
};
typedef
bi
::
list
<
thread
,
bi
::
member_hook
<
thread
,
bi
::
list_member_hook
<>
,
...
...
@@ -108,32 +134,6 @@ struct cpu {
thread
*
current
();
class
timer
;
class
timer_list
:
private
clock_event_callback
{
public:
timer_list
();
virtual
void
fired
();
private:
friend
class
timer
;
bi
::
set
<
timer
,
bi
::
base_hook
<
bi
::
set_base_hook
<>>>
_list
;
};
class
timer
:
public
bi
::
set_base_hook
<>
{
public:
explicit
timer
(
thread
&
t
);
~
timer
();
void
set
(
u64
time
);
bool
expired
()
const
;
void
cancel
();
friend
bool
operator
<
(
const
timer
&
t1
,
const
timer
&
t2
);
private:
thread
&
_t
;
bool
_expired
;
u64
_time
;
friend
class
timer_list
;
};
class
wait_guard
{
public:
wait_guard
(
thread
*
t
)
:
_t
(
t
)
{
t
->
prepare_wait
();
}
...
...
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