Created
November 1, 2021 08:29
-
-
Save dtest11/0fe3720f72c33dd6f69bfbc2de5bbeae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *Server) startGoRoutine(f func()) bool { | |
var started bool | |
s.grMu.Lock() | |
if s.grRunning { | |
s.grWG.Add(1) | |
go f() | |
started = true | |
} | |
s.grMu.Unlock() | |
return started | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment