-
-
Save fitomad/5e36c905b19576eb963be246820afd21 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