File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,19 @@ class QgsConnectionPoolGroup
9595 T acquire ( int timeout )
9696 {
9797 // we are going to acquire a resource - if no resource is available, we will block here
98- if ( !sem.tryAcquire ( 1 , timeout ) )
99- return nullptr ;
98+ if ( timeout >= 0 )
99+ {
100+ if ( !sem.tryAcquire ( 1 , timeout ) )
101+ return nullptr ;
102+ }
103+ else
104+ {
105+ // we should still be able to use tryAcquire with a negative timeout here, but
106+ // tryAcquire is broken on Qt > 5.8 with negative timeouts - see
107+ // https://bugreports.qt.io/browse/QTBUG-64413
108+ // https://lists.osgeo.org/pipermail/qgis-developer/2017-November/050456.html
109+ sem.acquire ( 1 );
110+ }
100111
101112 // quick (preferred) way - use cached connection
102113 {
You can’t perform that action at this time.
0 commit comments