Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: mozilla/nsprpub/pr/src/md/windows/w95thred.c

Issue 12089033: Update to NSPR 4.9.5 Beta 2, part 2: actual changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mozilla/nsprpub/pr/src/md/unix/uxwrap.c ('k') | mozilla/nsprpub/pr/src/misc/prerrortable.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mozilla/nsprpub/pr/src/md/windows/w95thred.c
===================================================================
--- mozilla/nsprpub/pr/src/md/windows/w95thred.c (revision 179237)
+++ mozilla/nsprpub/pr/src/md/windows/w95thred.c (working copy)
@@ -168,7 +168,43 @@
return;
}
+const DWORD MS_VC_EXCEPTION = 0x406D1388;
+
+#pragma pack(push,8)
+typedef struct tagTHREADNAME_INFO
+{
+ DWORD dwType; // Must be 0x1000.
+ LPCSTR szName; // Pointer to name (in user addr space).
+ DWORD dwThreadID; // Thread ID (-1=caller thread).
+ DWORD dwFlags; // Reserved for future use, must be zero.
+} THREADNAME_INFO;
+#pragma pack(pop)
+
void
+_PR_MD_SET_CURRENT_THREAD_NAME(const char *name)
+{
+#ifdef _MSC_VER
+ THREADNAME_INFO info;
+
+ if (!IsDebuggerPresent())
+ return;
+
+ info.dwType = 0x1000;
+ info.szName = (char*) name;
+ info.dwThreadID = -1;
+ info.dwFlags = 0;
+
+ __try {
+ RaiseException(MS_VC_EXCEPTION,
+ 0,
+ sizeof(info) / sizeof(ULONG_PTR),
+ (ULONG_PTR*)&info);
+ } __except(EXCEPTION_CONTINUE_EXECUTION) {
+ }
+#endif
+}
+
+void
_PR_MD_CLEAN_THREAD(PRThread *thread)
{
BOOL rv;
« no previous file with comments | « mozilla/nsprpub/pr/src/md/unix/uxwrap.c ('k') | mozilla/nsprpub/pr/src/misc/prerrortable.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698