Skip to content

Commit 6a53501

Browse files
committed
Fix concurrency test on iOS
1 parent 967e8f6 commit 6a53501

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/ConcurrencyTest.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ public Task Run()
4848
{
4949
while (true)
5050
{
51-
//
52-
// NOTE: Change this to readwrite and then it does work ???
53-
// No more IOERROR
54-
//
55-
56-
using (var dbConnection = new DbConnection(SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.ReadOnly))
51+
//
52+
// NOTE: Change this to readwrite and then it does work ???
53+
// No more IOERROR
54+
//
55+
56+
var flags = SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.ReadOnly;
57+
#if __IOS__
58+
flags = SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.ReadWrite;
59+
#endif
60+
using (var dbConnection = new DbConnection(flags))
5761
{
5862
var records = dbConnection.Table<TestObj>().ToList();
5963
System.Diagnostics.Debug.WriteLine($"{Environment.CurrentManagedThreadId} Read records: {records.Count}");

0 commit comments

Comments
 (0)