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

Side by Side Diff: third_party/tcmalloc/chromium/src/base/spinlock_posix-inl.h

Issue 9667026: Revert 126020 - Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2009, Google Inc. 1 /* Copyright (c) 2009, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace internal { 42 namespace internal {
43 43
44 void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) { 44 void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) {
45 int save_errno = errno; 45 int save_errno = errno;
46 if (loop == 0) { 46 if (loop == 0) {
47 } else if (loop == 1) { 47 } else if (loop == 1) {
48 sched_yield(); 48 sched_yield();
49 } else { 49 } else {
50 struct timespec tm; 50 struct timespec tm;
51 tm.tv_sec = 0; 51 tm.tv_sec = 0;
52 tm.tv_nsec = base::internal::SuggestedDelayNS(loop); 52 tm.tv_nsec = 1000000;
53 nanosleep(&tm, NULL); 53 nanosleep(&tm, NULL);
54 } 54 }
55 errno = save_errno; 55 errno = save_errno;
56 } 56 }
57 57
58 void SpinLockWake(volatile Atomic32 *w, bool all) { 58 void SpinLockWake(volatile Atomic32 *w, bool all) {
59 } 59 }
60 60
61 } // namespace internal 61 } // namespace internal
62 } // namespace base 62 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698