Instance Method インスタンスメソッド

addDependency(_:)

Makes the receiver dependent on the completion of the specified operation. レシーバをこの指定されたオペレーションの完了に依存するようにします。

Declaration 宣言

func addDependency(_ op: Operation)

Parameters パラメータ

operation

The operation on which the receiver should depend. The same dependency should not be added more than once to the receiver, and the results of doing so are undefined. それにレシーバが依存すべきオペレーション。同じ依存関係は、一度以上レシーバに加えられるべきではありません、そしてそうすることの結果は未定義です。

Discussion 議論

The receiver is not considered ready to execute until all of its dependent operations have finished executing. If the receiver is already executing its task, adding dependencies has no practical effect. This method may change the isReady and dependencies properties of the receiver. レシーバは、遂行する準備ができたとみなされません、それの依存オペレーションの全てが遂行を終了してしまうまでは。レシーバが既にそれのタスクを遂行中であるならば、依存関係を加えることは実質上の効果を持ちません。このメソッドは、レシーバのisReadyおよびdependenciesプロパティを変更するかもしれません。

It is a programmer error to create any circular dependencies among a set of operations. Doing so can cause a deadlock among the operations and may freeze your program. 何らかの循環を一揃いのオペレーションの間に作成することはプログラマの過失です。そうすることは、それらオペレーション間に膠着を引き起こしえます、そしてあなたのプログラムをフリーズさせるかもしれません。

See Also 参照

Managing Dependencies 依存関係を管理する