Commit Graph

25 Commits

Author SHA1 Message Date
Kim Topley
6194f37e1a Fix warnings in DispatchQueue.sync() implementation when using a compiler with SE-0176 support. 2017-06-30 08:45:15 -07:00
Slava Pestov
5accebf556 Merge pull request #5344 from karwa/clearspecific
[Overlay/Dispatch]: Change DispatchQueue.setSpecific to take an optional
2017-01-18 15:59:45 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
JP Simard
ea5b665afa prefer '-> Void' over '-> ()'
Apple and the Swift community has settled on this style:
https://devforums.apple.com/message/1133616#1133616

> FWIW, we've recently decided to standardize on () -> Void
> (generally, () for parameters and Void for return types) across all of our
> documentation.
2016-12-31 17:55:19 -08:00
Jordan Rose
7d61a5e6a2 [SDK] Use an extra shims header to remove _silgen_name from Dispatch.
We still have a bunch of redeclarations of Dispatch functions to avoid
the automatic bridging of dispatch_data_t and dispatch_block_t, but
mostly this is a vast reduction in complexity (and increase in safety).
2016-12-01 16:06:15 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
2024316e38 [gardening] Remove accidental trailing whitespace (" " and "\t") 2016-10-30 10:59:02 +01:00
SpringsUp
2ae2074de3 [Overlay/Dispatch]: Change DispatchQueue.setSpecific to take an optional
for its value
2016-10-18 13:57:02 +02:00
practicalswift
fa7fbdb8b0 [gardening] Remove redundant nil-initialization of optional variable
From the Swift documentation:

"If you define an optional variable without providing a default value,
 the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Michael Ilseman
b7c9eddd11 [noescape by default] drop @noescape from stdlib 2016-08-04 16:09:01 -07:00
Kevin Ballard
2530957bc6 Use shims for all calls to Dispatch APIs that take blocks
This ensures that blocks that come from `DispatchWorkItem`s will
function correctly.

The only exception is __dispatch_barrier_sync() as the block passed to
that call is not `@convention(block)` so it doesn't matter.

Fixes SR-2246.
2016-08-01 17:08:14 -07:00
Kevin Ballard
6fe9b13f12 Add fast path for queue.async(flags: .barrier)
Fixes SR-2248.
2016-08-01 14:58:30 -07:00
Doug Gregor
8219d4f42b Merge pull request #3853 from milseman/noescape_by_default
SE-0103 Noescape by default
2016-07-29 15:27:52 -07:00
Dmitri Gribenko
621d3b7c66 Merge pull request #3827 from mwwa/libdispatch-data-leak
[libdispatch-data-leak] DisaptchData never calls destructor
2016-07-29 14:58:37 -07:00
Michael Ilseman
ccda8f33d1 [noescape by default] Proliferate @escaping
Adds an explicit @escaping throughout the standard library, validation
test suite, and tests. This will be necessary as soon as noescape is
the default for closure parameters.
2016-07-29 13:48:07 -07:00
Matt Wright
a151db06cd [libdispatch-data-leak] DisaptchData never calls destructor
* _swift_dispatch_data_create should have been marked as returning a
    retained object, otherwise the object is never fully released and
    the destructor is never executed.

    Fixes: <rdar://problem/27577958>
2016-07-28 15:00:32 -07:00
Devin Coughlin
c459f34029 [libdispatch] Fix deprecation annotations for macOS, watchOS.
Several libdispatch APIs in Queue.swift are annotated as:

public enum GlobalQueuePriority {
  @available(OSX, deprecated: 10.10, message: "Use qos attributes instead")
  @available(*, deprecated: 8.0, message: "Use qos attributes instead")
  case high

This annotation means ".high is deprecated on all OSes in version 8.0 and
above", so the compiler had false positive deprecation warnings on macOS
when the minimum deployment target is 10.9 and false negatives on watchOS
when the deployment target is 2.0.

The fix is to explicitly enumerate the platforms the API is deprecated on. This
is not ideal (see SR-2155) but avoids the false positives and negatives.

This fixes https://bugs.swift.org/browse/SR-2153
2016-07-27 14:10:25 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
Jordan Rose
0712ffcb07 Convert the Dispatch and Foundation overlays to 'fileprivate'. (#3753)
Similar to the work in apple/swift-corelibs-foundation#445.

Groundwork for SE-0025 ('private' and 'fileprivate').
No intended functionality change.
2016-07-25 20:58:06 -07:00
Matt Wright
11a6dcd2b7 [libdispatch] Remove deprecated methods
* Removes methods introduces in Swift3 that were already marked
    deprecated based on pre-release review feedback.

    Fixes <rdar://problem/26479523>
2016-07-18 13:22:23 -07:00
Matt Wright
8ac413a0b5 [libdispatch] Post-beta API changes and bug fixes
* Fix DispatchSourceSignal initialisation such that it no longer
    registers for the wrong source type.

    * Remove (group:) option from DispatchWorkItem, introduce group
    options to `.async` methods that accept DispatchWorkItem.

    * Rename `DispatchSourceType` to `DispatchSourceProtocol`

    * Rework DispatchQueue attributes and flags into a less confusing
    approach.

    * Fixes:

	SR-1817, SR-1771, SR-1770, SR-1769

	<rdar://problem/26725156> <rdar://problem/26873917>
	<rdar://problem/26918843> <rdar://problem/26810149>
	<rdar://problem/27117023> <rdar://problem/27121422>
	<rdar://problem/27236887> <rdar://problem/27337555>
2016-07-18 13:22:23 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00