Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created December 3, 2015 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/0c9eb81b0896365752c6 to your computer and use it in GitHub Desktop.
Save fitomad/0c9eb81b0896365752c6 to your computer and use it in GitHub Desktop.
// 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