gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 18/21] Added support for libdispatch main queue in the main r


From: Jean-Charles BERTIN
Subject: Re: [PATCH 18/21] Added support for libdispatch main queue in the main run loop.
Date: Fri, 01 Mar 2013 19:15:22 +0100

Hmmm sorry but its clearly none of these solutions that will fix the
problem: if context watchers is empty the run loop will never execute
-[GSRunLoopCtxt pollUntil:within:]!

So I suggest an another patch to fix this.

Sorry for the inconvenience.
Regards

On Fri, 2013-03-01 at 17:39 +0100, Jean-Charles BERTIN wrote:
> Ok, I didn't see this one: by adding systematically the dispatch watcher
> in GSRunLoopCtxt for the main thread, I broke the -[NSRunLoop run] and
> -[NSRunLoop runUntilDate:] methods. Since there is always at least one
> watcher, the methods never return.
> 
> I wonder how I can correct this:
> 1/ add an ivar specialWatchers which is a GSIArray and add the dispatch
> watcher to it. We can then factorize the code in -[GSRunLoopCtxt
> pollUntil:within:] which prepare the poll to a new private method which
> could be like this: -(BOOL)_prepareForPoll:(GSIArray)watchers. This
> method returns the value of immediate variable.
> 2/ or add an ivar dispatchWatcher only if GS_HAVE_LIBDISPATCH_COMPAT
> macro is defined and handle it if not NULL inside -[GSRunLoopCtxt
> pollUntil:within:].
> 
> The main goal for these two solutions is to not modify the behavior of
> code where GSIArrayCount(context->watchers) is compared against zero.
> 
> I prefer the first one because this specialWatchers could be reused if
> needed. However it implies that every loop contexts will be impacted.
> 
> What do you think?
> 
> On Wed, 2013-02-27 at 17:29 +0100, Jean-Charles BERTIN wrote:
> > ---
> >  Source/GSRunLoopWatcher.h   |  11 +++
> >  Source/GSRunLoopWatcher.m   | 163 
> > ++++++++++++++++++++++++++++++++++++++++++--
> >  Source/unix/GSRunLoopCtxt.m |  13 ++++
> >  3 files changed, 182 insertions(+), 5 deletions(-)
> > 
> > _______________________________________________
> > Gnustep-dev mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/gnustep-dev
> 
> _______________________________________________
> Gnustep-dev mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/gnustep-dev

-- 
Jean-Charles BERTIN
Axinoe - Software Engineer
Tel.: (+33) (0)1.80.82.59.23
Fax : (+33) (0)1.80.82.59.29
Skype: jcbertin
Web: <http://www.axinoe.com/>
Certificate Authority: <https://ca.axinoe.com/axinoe-root.crt>

Attachment: Fix-NSRunLoop-for-libdispatch-main-queue.patch
Description: Text Data

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]