Skip to content

Instantly share code, notes, and snippets.

@pablomatiasgomez
Created June 29, 2015 18:01
Show Gist options
  • Save pablomatiasgomez/33d18b9cde2027f95e26 to your computer and use it in GitHub Desktop.
Save pablomatiasgomez/33d18b9cde2027f95e26 to your computer and use it in GitHub Desktop.
How to get a deadlock in three simple lines
int connections_node_getActiveConnectedCount() {
pthread_mutex_lock(&activeNodesLock);
return dictionary_size(activeNodesSockets);
pthread_mutex_unlock(&activeNodesLock);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment