[PR #665] [MERGED] Fix deadlock in SetText #1008

Closed
opened 2026-03-04 01:08:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/665
Author: @SamWhited
Created: 10/29/2021
Status: Merged
Merged: 10/29/2021
Merged by: @rivo

Base: masterHead: fix_crash


📝 Commits (1)

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 textview.go (+4 -4)

📄 Description

I realized right as I saw the email that the batch stuff had been merged that my change to the locking in SetText would obviously cause a deadlock (we aquire the lock, then the Write method is called which also tries to aquire the lock).

If you'd permit me, I'd like to write tests for some of the functions in this library, it could have prevented this being merged in the first place if I'd written some tests about it. While you consider it though I've pushed up this fix quickly that at least lets SetText be usable again.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/665 **Author:** [@SamWhited](https://github.com/SamWhited) **Created:** 10/29/2021 **Status:** ✅ Merged **Merged:** 10/29/2021 **Merged by:** [@rivo](https://github.com/rivo) **Base:** `master` ← **Head:** `fix_crash` --- ### 📝 Commits (1) - [`d0d3379`](https://github.com/rivo/tview/commit/d0d3379128904b63c732265d6972fefa807a9cd5) Fix deadlock in SetText ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `textview.go` (+4 -4) </details> ### 📄 Description I realized right as I saw the email that the batch stuff had been merged that my change to the locking in SetText would obviously cause a deadlock (we aquire the lock, then the Write method is called which also tries to aquire the lock). If you'd permit me, I'd like to write tests for some of the functions in this library, it could have prevented this being merged in the first place if I'd written some tests about it. While you consider it though I've pushed up this fix quickly that at least lets SetText be usable again. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:08:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#1008
No description provided.