提交 1ab70a56 编写于 作者: M Matt Pharr

Merge branch 'master' of github.com:mmp/pbrt-v4

......@@ -78,8 +78,11 @@ inline T &ThreadLocal<T>::Get() {
return threadLocal;
} else if (!hashTable[hash]) {
mutex.unlock_shared();
T newItem = create();
// Get reader-writer lock before calling the callback so that the user
// doesn't have to worry about writing a thread-safe callback.
mutex.lock();
T newItem = create();
if (hashTable[hash]) {
// someone else got there first--keep looking, but now
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册