Bug 15111 - DispatchQueue GCD wrapper is missing method dispatch_after
Summary: DispatchQueue GCD wrapper is missing method dispatch_after
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.4.4
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-10-01 19:11 UTC by Jon Goldberger [MSFT]
Modified: 2013-10-02 08:48 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jon Goldberger [MSFT] 2013-10-01 19:11:16 UTC
Just wondering how to call the following in C#:


dispatch_after(DISPATCH_TIME_NOW, dispatch_get_main_queue(), ^(void)
{
    ….
});

DispatchQueue.Main does not contain a DispatchAfter method.
Comment 2 Sebastien Pouliot 2013-10-01 20:49:19 UTC
The direct answer would be <quote>Passing DISPATCH_TIME_NOW as the when parameter is supported, but is not as optimal as calling dispatch_async instead.</quote> [1]

IOW use DispatchAsync (already present and optimal :-)

[1] https://developer.apple.com/library/ios/documentation/performance/reference/gcd_libdispatch_ref/Reference/reference.html#//apple_ref/c/func/dispatch_after_f

note: I'm not closing the bug, we'll bind it in case it's needed for something other than DISPATCH_TIME_NOW).
Comment 3 Sebastien Pouliot 2013-10-02 08:48:17 UTC
Fixed in master d8529bcb2d275e60afdeec23fc00444d0357657f

QA: unit tests added in the same revision