recommend a EventHandler.Do() am: 2a95e590b6
am: 0ca2d0cb67
am: 36551c5a13
am: b32f848409
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2095267 Change-Id: I219c2c5a8faadd60bfcf40e0e62aef684b861a65 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
ee0e8d0a28
2 changed files with 8 additions and 1 deletions
|
@ -3648,7 +3648,7 @@ func (c *Context) SingletonName(singleton Singleton) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// WriteBuildFile writes the Ninja manifeset text for the generated build
|
||||
// WriteBuildFile writes the Ninja manifest text for the generated build
|
||||
// actions to w. If this is called before PrepareBuildActions successfully
|
||||
// completes then ErrBuildActionsNotReady is returned.
|
||||
func (c *Context) WriteBuildFile(w io.StringWriter) error {
|
||||
|
|
|
@ -62,6 +62,13 @@ func (h *EventHandler) Begin(name string) {
|
|||
h.scopeStartTimes = append(h.scopeStartTimes, _now())
|
||||
}
|
||||
|
||||
// Do wraps a function with calls to Begin() and End().
|
||||
func (h *EventHandler) Do(name string, f func()) {
|
||||
h.Begin(name)
|
||||
defer h.End(name)
|
||||
f()
|
||||
}
|
||||
|
||||
// End logs the end of an event. All events nested within this event must have
|
||||
// themselves been marked completed.
|
||||
func (h *EventHandler) End(name string) {
|
||||
|
|
Loading…
Reference in a new issue