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

Unified Diff: src/platform.h

Issue 113030: X64: Fixed conversion between tread_id (int) and void*. (Closed)
Patch Set: Addressed review comments Created 11 years, 7 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 | « no previous file | src/v8threads.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform.h
diff --git a/src/platform.h b/src/platform.h
index b70095b12024f3dc63c27c8de87c28872ee4470f..a34661505564665407a814a43287b7309605707b 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -350,7 +350,16 @@ class Thread: public ThreadHandle {
static LocalStorageKey CreateThreadLocalKey();
static void DeleteThreadLocalKey(LocalStorageKey key);
static void* GetThreadLocal(LocalStorageKey key);
+ static int GetThreadLocalInt(LocalStorageKey key) {
+ return static_cast<int>(reinterpret_cast<intptr_t>(GetThreadLocal(key)));
+ }
static void SetThreadLocal(LocalStorageKey key, void* value);
+ static void SetThreadLocalInt(LocalStorageKey key, int value) {
+ SetThreadLocal(key, reinterpret_cast<void*>(static_cast<intptr_t>(value)));
+ }
+ static bool HasThreadLocal(LocalStorageKey key) {
+ return GetThreadLocal(key) != NULL;
+ }
// A hint to the scheduler to let another thread run.
static void YieldCPU();
« no previous file with comments | « no previous file | src/v8threads.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698