OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 #include <windows.h> | 35 #include <windows.h> |
36 | 36 |
37 namespace base { | 37 namespace base { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) { | 40 void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) { |
41 if (loop == 0) { | 41 if (loop == 0) { |
42 } else if (loop == 1) { | 42 } else if (loop == 1) { |
43 Sleep(0); | 43 Sleep(0); |
44 } else { | 44 } else { |
45 // TODO(dmikurube): Re-enable the commented-out code. | |
46 // We commented out the following line and used the old code "Sleep(1)" | |
47 // since base/atomicops-internals-windows.h doesn't support 64-bit | |
48 // operations. | |
49 // | |
50 // Commended-out code: | |
51 // Sleep(base::internal::SuggestedDelayNS(loop) / 1000000); | |
52 Sleep(1); | 45 Sleep(1); |
53 } | 46 } |
54 } | 47 } |
55 | 48 |
56 void SpinLockWake(volatile Atomic32 *w, bool all) { | 49 void SpinLockWake(volatile Atomic32 *w, bool all) { |
57 } | 50 } |
58 | 51 |
59 } // namespace internal | 52 } // namespace internal |
60 } // namespace base | 53 } // namespace base |
OLD | NEW |