Skip to content

Instantly share code, notes, and snippets.

@vvuk
Created February 27, 2013 01:03
Show Gist options
  • Save vvuk/5043972 to your computer and use it in GitHub Desktop.
Save vvuk/5043972 to your computer and use it in GitHub Desktop.
diff --git a/src/library.js b/src/library.js
index d0f73fd..955755e 100644
--- a/src/library.js
+++ b/src/library.js
@@ -6743,11 +6743,12 @@ LibraryManager.library = {
pthread_key_create: function(key, destructor) {
if (!_pthread_key_create.keys) _pthread_key_create.keys = {};
- _pthread_key_create.keys[key] = null;
+ // values start at 0
+ _pthread_key_create.keys[key] = 0;
},
pthread_getspecific: function(key) {
- return _pthread_key_create.keys[key];
+ return _pthread_key_create.keys[key] || 0;
},
pthread_setspecific: function(key, value) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment