summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-11 17:18:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-11 17:18:02 -0400
commit67adbd43a1bbf35fdc3963b34ae5631758006fee (patch)
treea1f32908e14e818b427599924d08c81db1174305
parent2c7c8b3a6b522cf64c66d606dab6c7a6fb75e2e3 (diff)
Revert "Settled race condition TODOs across all platforms... as an unfortunate case :("
Things broke when introducing this after the new GC... let's see if this broke under the new GC or not. This reverts commit b198a4dfec53a15eac5cdca9fe9d91c145a0119c.
-rw-r--r--redo/table_darwin.go14
-rw-r--r--redo/table_unix.go18
-rw-r--r--redo/table_windows.go14
3 files changed, 17 insertions, 29 deletions
diff --git a/redo/table_darwin.go b/redo/table_darwin.go
index 95344c1..c80dbdc 100644
--- a/redo/table_darwin.go
+++ b/redo/table_darwin.go
@@ -36,15 +36,11 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table {
func (t *table) Unlock() {
t.unlock()
- // there's a possibility that user actions can happen at this point, before the view is updated
- // alas, this is something we have to deal with, because Unlock() can be called from any thread
- go func() {
- Do(func() {
- t.RLock()
- defer t.RUnlock()
- C.tableUpdate(t._id)
- })
- }()
+ // TODO RACE CONDITION HERE
+ // not sure about this one...
+ t.RLock()
+ defer t.RUnlock()
+ C.tableUpdate(t._id)
}
//export goTableDataSource_getValue
diff --git a/redo/table_unix.go b/redo/table_unix.go
index d618663..611beae 100644
--- a/redo/table_unix.go
+++ b/redo/table_unix.go
@@ -58,17 +58,13 @@ func (t *table) Lock() {
func (t *table) Unlock() {
t.unlock()
- // there's a possibility that user actions can happen at this point, before the view is updated
- // alas, this is something we have to deal with, because Unlock() can be called from any thread
- go func() {
- Do(func() {
- t.RLock()
- defer t.RUnlock()
- d := reflect.Indirect(reflect.ValueOf(t.data))
- new := C.gint(d.Len())
- C.tableUpdate(t.model, t.old, new)
- })
- }()
+ // TODO RACE CONDITION HERE
+ // not sure about this one...
+ t.RLock()
+ defer t.RUnlock()
+ d := reflect.Indirect(reflect.ValueOf(t.data))
+ new := C.gint(d.Len())
+ C.tableUpdate(t.model, t.old, new)
}
//export goTableModel_get_n_columns
diff --git a/redo/table_windows.go b/redo/table_windows.go
index be9427e..576ae4a 100644
--- a/redo/table_windows.go
+++ b/redo/table_windows.go
@@ -38,15 +38,11 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table {
func (t *table) Unlock() {
t.unlock()
- // there's a possibility that user actions can happen at this point, before the view is updated
- // alas, this is something we have to deal with, because Unlock() can be called from any thread
- go func() {
- Do(func() {
- t.RLock()
- defer t.RUnlock()
- C.tableUpdate(t._hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
- })
- }()
+ // TODO RACE CONDITION HERE
+ // I think there's a way to set the item count without causing a refetch of data that works around this...
+ t.RLock()
+ defer t.RUnlock()
+ C.tableUpdate(t._hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
}
//export tableGetCellText