| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Windows doesn't support pthread_key_create's destr_function, and in fact | 5 // Windows doesn't support pthread_key_create's destr_function, and in fact |
| 6 // it's a bit tricky to get code to run when a thread exits. This is | 6 // it's a bit tricky to get code to run when a thread exits. This is |
| 7 // cargo-cult magic from http://www.codeproject.com/threads/tls.asp. | 7 // cargo-cult magic from http://www.codeproject.com/threads/tls.asp. |
| 8 // We are trying to be compatible with both a LoadLibrary style invocation, as | 8 // We are trying to be compatible with both a LoadLibrary style invocation, as |
| 9 // well as static linking. This code only needs to be included if we use | 9 // well as static linking. This code only needs to be included if we use |
| 10 // LoadLibrary, but it hooks into the "standard" set of TLS callbacks that are | 10 // LoadLibrary, but it hooks into the "standard" set of TLS callbacks that are |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // call all items. | 116 // call all items. |
| 117 // If we are called, it means that some other system is scanning the callbacks | 117 // If we are called, it means that some other system is scanning the callbacks |
| 118 // and we don't need to do so in DllMain(). | 118 // and we don't need to do so in DllMain(). |
| 119 linker_notifications_are_active = true; | 119 linker_notifications_are_active = true; |
| 120 // Note: If some other routine some how plays this same game... we could both | 120 // Note: If some other routine some how plays this same game... we could both |
| 121 // decide not to do the scanning <sigh>, but this trick should suppress | 121 // decide not to do the scanning <sigh>, but this trick should suppress |
| 122 // duplicate calls on Vista, where the runtime takes care of the callbacks, | 122 // duplicate calls on Vista, where the runtime takes care of the callbacks, |
| 123 // and allow us to do the callbacks on XP, where we are currently devoid of | 123 // and allow us to do the callbacks on XP, where we are currently devoid of |
| 124 // callbacks (due to an explicit LoadLibrary call). | 124 // callbacks (due to an explicit LoadLibrary call). |
| 125 } | 125 } |
| OLD | NEW |