1
0
Fork 0
forked from External/ergo

remove unnecessary indirection in semaphore

This commit is contained in:
Shivaram Lingamneni 2021-04-07 08:44:17 -04:00
parent 549d06bc98
commit 5b33cd436f
7 changed files with 39 additions and 40 deletions

View file

@ -40,10 +40,10 @@ type Socket struct {
// NewSocket returns a new Socket.
func NewSocket(conn IRCConn, maxSendQBytes int) *Socket {
result := Socket{
conn: conn,
maxSendQBytes: maxSendQBytes,
conn: conn,
maxSendQBytes: maxSendQBytes,
writerSemaphore: utils.NewSemaphore(1),
}
result.writerSemaphore.Initialize(1)
return &result
}