Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Commit

Permalink
Methodize & rename default signal handling func
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Jan 11, 2017
1 parent 88027db commit 4af1eef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func TestSignalHandling(t *testing.T) {
clean()

sm, clean = mkNaiveSM(t)
SetUpSigHandling(sm)
sm.UseDefaultSignalHandling()
go sm.DeduceProjectRoot("rsc.io/pdf")
runtime.Gosched()

Expand Down Expand Up @@ -769,9 +769,9 @@ func TestSignalHandling(t *testing.T) {
clean()

sm, clean = mkNaiveSM(t)
SetUpSigHandling(sm)
sm.UseDefaultSignalHandling()
sm.StopSignalHandling()
SetUpSigHandling(sm)
sm.UseDefaultSignalHandling()

go sm.DeduceProjectRoot("rsc.io/pdf")
//runtime.Gosched()
Expand Down
4 changes: 2 additions & 2 deletions source_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func NewSourceManager(an ProjectAnalyzer, cachedir string) (*SourceMgr, error) {
return sm, nil
}

// SetUpSigHandling sets up typical os.Interrupt signal handling for a
// UseDefaultSignalHandling sets up typical os.Interrupt signal handling for a
// SourceMgr.
func SetUpSigHandling(sm *SourceMgr) {
func (sm *SourceMgr) UseDefaultSignalHandling() {
sigch := make(chan os.Signal, 1)
signal.Notify(sigch, os.Interrupt)
sm.HandleSignals(sigch)
Expand Down

0 comments on commit 4af1eef

Please sign in to comment.