Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: fix unresponsive pubsub chat example #1652

Merged

Conversation

goforbroke1006
Copy link
Contributor

Update ui for example
examples/pubsub/chat/ui.go:125

Remove unneeded lock on peersList textview.
Clear method already has lock.

// Clear removes all text from the buffer.
func (t *TextView) Clear() *TextView {
	t.Lock()
	defer t.Unlock()

	t.clear()
	return t
}

@marten-seemann marten-seemann requested a review from vyzo July 9, 2022 22:36
@BigLep BigLep linked an issue Aug 5, 2022 that may be closed by this pull request
@marten-seemann marten-seemann changed the title #1651 fix pubsub chat example examples: fix unresponsive pubsub chat example Aug 9, 2022
Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear indeed does lock a mutex, so I assume it's thread-safe.

@marten-seemann marten-seemann merged commit a5e9114 into libp2p:master Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples pubsub chat application is not responding
2 participants