sched_event.hh (13063:c9905ead0041) sched_event.hh (13072:f2b83208ab54)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 45 unchanged lines hidden (view full) ---

54 }
55
56 void deschedule() { _scheduled = false; }
57 public:
58 ScEvent(std::function<void()> work) :
59 work(work), _when(MaxTick), _scheduled(false)
60 {}
61
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 45 unchanged lines hidden (view full) ---

54 }
55
56 void deschedule() { _scheduled = false; }
57 public:
58 ScEvent(std::function<void()> work) :
59 work(work), _when(MaxTick), _scheduled(false)
60 {}
61
62 ~ScEvent();
63
62 bool scheduled() { return _scheduled; }
63
64 void when(Tick w) { _when = w; }
65 Tick when() { return _when; }
66
67 void run() { deschedule(); work(); }
68};
69
70} // namespace sc_gem5
71
72#endif // __SYSTEMC_CORE_SCHED_EVENT_HH__
64 bool scheduled() { return _scheduled; }
65
66 void when(Tick w) { _when = w; }
67 Tick when() { return _when; }
68
69 void run() { deschedule(); work(); }
70};
71
72} // namespace sc_gem5
73
74#endif // __SYSTEMC_CORE_SCHED_EVENT_HH__