Commit d2b65056 authored by Martin Karsten's avatar Martin Karsten
Browse files

Merge branch 'tls-null' into 'master'

- match pthread_getspecific behavior for uninitialized keys

See merge request mkarsten/libfibre!3
parents f76a150a 8695ea66
......@@ -78,8 +78,7 @@ public:
void* getspecific(size_t idx) {
RASSERT(bitmap.test(idx), idx);
RASSERT(idx < values.size(), idx);
return values[idx];
return idx < values.size() ? values[idx] : nullptr;
static size_t key_create(Destructor d = nullptr) {
ScopedLock<FastMutex> sl(mutex);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment