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 b198a4dfec.
This commit is contained in:
Pietro Gagliardi 2014-08-11 17:18:02 -04:00
parent 2c7c8b3a6b
commit 67adbd43a1
3 changed files with 17 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -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