modinit.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. //
  14. // Defines system wide MODULE_INIT priority values.
  15. // The higher the value the earlier it will be created.
  16. // Destruction is in reverse priority, i.e. highest will be destoyed last.
  17. //
  18. // Note: InitModuleObjects must be called asap in main body of each exe
  19. // (Although in Win32, objects will be initialized by standard OS dll dependency loading if not called).
  20. //
  21. // Note: ExitModuleObjects is called automatically by atexit or signal handlers on exit.
  22. #define INIT_PRIORITY_SYSTEM 0xF000 // system, calls to system or non-dependent calls (can be called asap)
  23. #define INIT_PRIORITY_JLOG INIT_PRIORITY_SYSTEM+0x950
  24. #define INIT_PRIORITY_JDEBUG1 INIT_PRIORITY_SYSTEM+0x900
  25. #define INIT_PRIORITY_JHEAP INIT_PRIORITY_SYSTEM+0x800
  26. #define INIT_PRIORITY_JIFACE INIT_PRIORITY_SYSTEM+0x800
  27. #define INIT_PRIORITY_JPROP INIT_PRIORITY_SYSTEM+0x800
  28. #define INIT_PRIORITY_JTIME INIT_PRIORITY_SYSTEM+0x800
  29. #define INIT_PRIORITY_JHASH INIT_PRIORITY_SYSTEM+0x800
  30. #define INIT_PRIORITY_JPTREE INIT_PRIORITY_SYSTEM+0x700
  31. #define INIT_PRIORITY_JMISC1 INIT_PRIORITY_SYSTEM+0x500
  32. #define INIT_PRIORITY_JDEBUG2 INIT_PRIORITY_SYSTEM+0x500
  33. #define INIT_PRIORITY_JMISC2 INIT_PRIORITY_SYSTEM+0x400
  34. #define INIT_PRIORITY_JTHREAD INIT_PRIORITY_SYSTEM+0x300
  35. #define INIT_PRIORITY_JBROADCAST INIT_PRIORITY_SYSTEM+0x200
  36. #define INIT_PRIORITY_JFILE INIT_PRIORITY_SYSTEM+0x200
  37. #define INIT_PRIORITY_JLIB_DEPENDENT 0xE000 // requires module objects in jlib to have been initialized.
  38. #define INIT_PRIORITY_DALI_DEPENDENT 0xD000 // requires module objects in dali to have been initalized.
  39. #define INIT_PRIORITY_STANDARD 0x1000 // non inter dependent, can be initialized late, destroyed early
  40. // but might use jlib etc.
  41. // These should be reviewed:
  42. // Most if not all of these could use standard priority I suspect. Some *were* initialized before some jlib elements.
  43. #define INIT_PRIORITY_HQLINTERNAL INIT_PRIORITY_STANDARD+0x200 // before standard so hash table created.
  44. #define INIT_PRIORITY_HQLMETA INIT_PRIORITY_STANDARD+0x280 // after atom, before internal
  45. #define INIT_PRIORITY_HQLATOM INIT_PRIORITY_STANDARD+0x300 // before hqlinternal
  46. #define INIT_PRIORITY_DEFTYPE INIT_PRIORITY_STANDARD+0x400 // before hqlinternal
  47. #define INIT_PRIORITY_DEFVALUE INIT_PRIORITY_STANDARD+0x300 // before hqlinternal
  48. #define INIT_PRIORITY_ENV_DALIENV INIT_PRIORITY_STANDARD+100
  49. #define INIT_PRIORITY_ENV_ENVIRONMENT INIT_PRIORITY_STANDARD+150
  50. #define INIT_PRIORITY_REMOTE_RMTFILE INIT_PRIORITY_STANDARD+100
  51. #define INIT_PRIORITY_JHTREE_JHTREE INIT_PRIORITY_STANDARD+150
  52. #define INIT_PRIORITY_ECLRTL_ECLRTL INIT_PRIORITY_STANDARD+0x100
  53. #define INIT_PRIORITY_MP_MPTAG INIT_PRIORITY_STANDARD+100
  54. // No longer used, (for reference only)
  55. #define INIT_PRIORITY_COMMONEXT 50
  56. #define INIT_PRIORITY_THOR_THDEMONSERVER 100
  57. #define INIT_PRIORITY_THOR_THORPORT 100
  58. #define INIT_PRIORITY_THOR_THSLAVEPROXY 100
  59. #define INIT_PRIORITY_THOR_THORMISC 100
  60. #define INIT_PRIORITY_DALI_DASDS 100
  61. #define INIT_PRIORITY_DALI_DASESS 100
  62. #define INIT_PRIORITY_DALI_DASERVER 100