diff options
author | Aaron Klotz <aklotz@mozilla.com> | 2015-12-22 11:50:00 -0800 |
---|---|---|
committer | Aaron Klotz <aklotz@mozilla.com> | 2015-12-22 11:50:00 -0800 |
commit | fcc1e08cf64d5fa27091ebd7b54ca2c748680dbf (patch) | |
tree | 91f774785cb18528e647f218501267dc57264524 | |
parent | 30e7f92662b26b2624649558a3e81d561cb0332c (diff) | |
download | nspr-hg-fcc1e08cf64d5fa27091ebd7b54ca2c748680dbf.tar.gz |
Bug 1234406: Set PRThread->md.id and PRThread->id when attaching
existing Win32 threads. r=wtc
-rw-r--r-- | pr/src/md/windows/w95thred.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pr/src/md/windows/w95thred.c b/pr/src/md/windows/w95thred.c index 932c50c3..c27d982a 100644 --- a/pr/src/md/windows/w95thred.c +++ b/pr/src/md/windows/w95thred.c @@ -65,7 +65,7 @@ _PR_MD_INIT_THREAD(PRThread *thread) ** suspending). Therefore, get a real handle from ** the pseudo handle via DuplicateHandle(...) */ - DuplicateHandle( + BOOL ok = DuplicateHandle( GetCurrentProcess(), /* Process of source handle */ GetCurrentThread(), /* Pseudo Handle to dup */ GetCurrentProcess(), /* Process of handle */ @@ -73,6 +73,11 @@ _PR_MD_INIT_THREAD(PRThread *thread) 0L, /* access flags */ FALSE, /* Inheritable */ DUPLICATE_SAME_ACCESS); /* Options */ + if (!ok) { + return PR_FAILURE; + } + thread->id = GetCurrentThreadId(); + thread->md.id = thread->id; } /* Create the blocking IO semaphore */ |