Created
October 24, 2016 01:30
-
-
Save toshi0383/020644b62934560594c257f093b97bb4 to your computer and use it in GitHub Desktop.
これなんでdoneにならないんだろう。 #CodePiece
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
var done = false | |
DispatchQueue.main.async { | |
print("hello") | |
done = true | |
} | |
while !done { | |
print("waiting... done:\(done)") | |
sleep(1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment