| OLD | NEW |
| (Empty) |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| 5 | |
| 6 #ifndef NSPR_STATIC /* See the end of w95thred.c. */ | |
| 7 | |
| 8 /* | |
| 9 * The DLL entry point (DllMain) for NSPR. | |
| 10 * | |
| 11 * This is used to detach threads that were automatically attached by | |
| 12 * nspr. | |
| 13 */ | |
| 14 | |
| 15 #include <windows.h> | |
| 16 #include <primpl.h> | |
| 17 | |
| 18 BOOL WINAPI DllMain( | |
| 19 HINSTANCE hinstDLL, | |
| 20 DWORD fdwReason, | |
| 21 LPVOID lpvReserved) | |
| 22 { | |
| 23 PRThread *me; | |
| 24 | |
| 25 switch (fdwReason) { | |
| 26 case DLL_PROCESS_ATTACH: | |
| 27 break; | |
| 28 case DLL_THREAD_ATTACH: | |
| 29 break; | |
| 30 case DLL_THREAD_DETACH: | |
| 31 if (_pr_initialized) { | |
| 32 me = _MD_GET_ATTACHED_THREAD(); | |
| 33 if ((me != NULL) && (me->flags & _PR_ATTACHED)) | |
| 34 _PRI_DetachThread(); | |
| 35 } | |
| 36 break; | |
| 37 case DLL_PROCESS_DETACH: | |
| 38 break; | |
| 39 } | |
| 40 return TRUE; | |
| 41 } | |
| 42 | |
| 43 #endif | |
| OLD | NEW |