summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_sync_channel.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
commitfa87a2527ca8c0bcef92d8e44791332782936911 (patch)
tree04dc5d1e6881f8356f91203a386648057b20d924 /chrome/common/ipc_sync_channel.cc
parent4f64d0af5908e36d356c834005d08cca98d579fe (diff)
downloadchromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.zip
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.gz
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.bz2
Revert. Failing unit tests.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_sync_channel.cc')
-rw-r--r--chrome/common/ipc_sync_channel.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/common/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc
index 3932c6d..25a22c8 100644
--- a/chrome/common/ipc_sync_channel.cc
+++ b/chrome/common/ipc_sync_channel.cc
@@ -57,8 +57,7 @@ namespace IPC {
// sync message while another one is blocked).
// Holds a pointer to the per-thread ReceivedSyncMsgQueue object.
-// TODO(evanm): this shouldn't rely on static initialization.
-static TLSSlot g_tls_index;
+static int g_tls_index = ThreadLocalStorage::Alloc();
class SyncChannel::ReceivedSyncMsgQueue :
public base::RefCountedThreadSafe<ReceivedSyncMsgQueue> {
@@ -70,10 +69,10 @@ class SyncChannel::ReceivedSyncMsgQueue :
}
~ReceivedSyncMsgQueue() {
- DCHECK(g_tls_index.Get());
+ DCHECK(ThreadLocalStorage::Get(g_tls_index));
DCHECK(MessageLoop::current() == listener_message_loop_);
CloseHandle(blocking_event_);
- g_tls_index.Set(NULL);
+ ThreadLocalStorage::Set(g_tls_index, NULL);
}
// Called on IPC thread when a synchronous message or reply arrives.
@@ -238,13 +237,14 @@ SyncChannel::SyncContext::SyncContext(
reply_deserialize_result_(false) {
// We want one ReceivedSyncMsgQueue per listener thread (i.e. since multiple
// SyncChannel objects that can block the same thread).
- received_sync_msgs_ = static_cast<ReceivedSyncMsgQueue*>(g_tls_index.Get());
+ received_sync_msgs_ = static_cast<ReceivedSyncMsgQueue*>(
+ ThreadLocalStorage::Get(g_tls_index));
if (!received_sync_msgs_) {
// Stash a pointer to the listener thread's ReceivedSyncMsgQueue, as we
// need to be able to access it in the IPC thread.
received_sync_msgs_ = new ReceivedSyncMsgQueue();
- g_tls_index.Set(received_sync_msgs_);
+ ThreadLocalStorage::Set(g_tls_index, received_sync_msgs_);
}
// Addref manually so that we can ensure destruction on the listener thread