Created
December 3, 2015 15:54
-
-
Save fitomad/0c9eb81b0896365752c6 to your computer and use it in GitHub Desktop.
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
// Creacion de un semaforo | |
let semaphore: dispatch_semaphore_t = dispatch_semaphore_create(0) | |
// Liberamos el semaforo. | |
//La ejecuion puede continuar | |
dispatch_semaphore_signal(semaphore) | |
// Este es el punto de bloqueo. | |
// Aqui esperamos a que se llame | |
// a la funcion `dispatch_semaphore_signal(sem)` | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment