Skip to content

Instantly share code, notes, and snippets.

View gustavoanatoly's full-sized avatar

Gustavo Anatoly Fernandes Velásquez Solís gustavoanatoly

  • João Pessoa - PB, Brasil
View GitHub Profile
@gustavoanatoly
gustavoanatoly / thread.c
Created October 17, 2012 17:32
deadlock; recursive lock
/*
* call-seq:
* mutex.try_lock -> true or false
*
* Attempts to obtain the lock and returns immediately. Returns +true+ if the
* lock was granted.
*/
VALUE
rb_mutex_trylock(VALUE self) {