gs-bim-air 2.0.0-beta.4 → 2.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +18 -0
  2. package/demo/assets/demo.css +28 -0
  3. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//344/277/256/346/224/271/351/242/234/350/211/262.html +124 -0
  4. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//345/212/250/347/224/273/346/214/211/351/222/256.html +141 -141
  5. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//346/265/213/351/207/217/351/253/230/347/250/213.html +162 -166
  6. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//346/267/273/345/212/240/346/226/207/346/234/254/346/240/207/347/255/276.html +125 -129
  7. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//346/267/273/345/212/240/346/240/207/347/255/276/344/272/213/344/273/266/347/202/271/345/207/273/350/216/267/345/217/226/345/261/236/346/200/247.html +8 -18
  8. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//346/267/273/345/212/240/351/274/240/346/240/207/344/272/213/344/273/266/350/216/267/345/217/226/346/250/241/345/236/213.html +9 -19
  9. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//347/247/273/345/212/250/346/240/207/347/255/276/344/275/215/347/275/256.html +135 -139
  10. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//350/247/206/347/202/271/347/256/241/347/220/206.html +102 -97
  11. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//350/247/206/350/247/222/350/275/254/346/215/242.html +107 -112
  12. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//350/256/276/347/275/256/347/273/223/346/236/204/346/240/221/347/202/271/345/207/273/344/272/213/344/273/266.html +8 -18
  13. package/demo//345/217/202/346/225/260/345/214/226/350/256/276/350/256/241//345/217/202/346/225/260/345/214/226/345/273/272/346/250/241.html +5 -35
  14. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/227/213/350/275/254/345/271/263/347/247/273/347/274/251/346/224/276.html +128 -0
  15. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//350/256/276/347/275/256viewHouse.html +92 -0
  16. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//351/232/220/350/227/217/345/274/272/350/260/203.html +124 -0
  17. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//345/273/272/347/255/221/346/210/277/345/261/213/350/277/233/345/272/246/346/250/241/346/213/237-/351/232/224/347/246/273/347/224/237/351/225/277.html +100 -0
  18. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//346/226/275/345/267/245/350/277/233/345/272/246/346/250/241/346/213/237-/350/267/257/345/276/204/345/212/250/347/224/273/347/224/237/351/225/277.html +626 -0
  19. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//347/256/241/350/267/257/350/277/233/345/272/246/346/250/241/346/213/237-/347/256/241/351/201/223/347/224/237/351/225/277.html +153 -0
  20. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//350/267/257/345/276/204/345/212/250/347/224/273.html +119 -87
  21. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//345/210/233/345/273/272/350/247/206/345/233/276.html +8 -18
  22. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//345/212/240/350/275/275/346/234/215/345/212/241/345/231/250/346/250/241/345/236/213.html +8 -18
  23. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//345/217/214/345/261/217/346/223/215/344/275/234.html +10 -8
  24. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//345/256/232/344/275/215/346/250/241/345/236/213.html +17 -19
  25. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//345/267/245/345/205/267/346/240/217/346/230/276/347/244/272/351/232/220/350/227/217.html +74 -0
  26. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/212/225/345/275/261/346/226/271/345/274/217/345/217/230/346/215/242.html +78 -0
  27. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/230/276/347/244/272/347/233/270/346/234/272/345/217/202/346/225/260.html +121 -114
  28. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//350/216/267/345/217/226/347/233/270/346/234/272/345/217/202/346/225/260.html +138 -0
  29. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//350/256/276/347/275/256/344/270/216/350/216/267/345/217/226/346/250/241/345/236/213/345/235/220/346/240/207.html +25 -24
  30. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//351/224/201/345/256/232/347/233/270/346/234/272/350/247/206/350/247/222.html +109 -0
  31. package/demo//346/250/241/345/236/213/346/225/210/346/236/234/2D/347/203/255/345/212/233/345/233/276.html +47 -48
  32. package/demo//346/250/241/345/236/213/346/225/210/346/236/234/{BIM+GIS.html → BIMGIS/347/244/272/344/276/213.html} +8 -17
  33. package/demo//346/250/241/345/236/213/346/225/210/346/236/234/UV/345/212/250/347/224/273.html +9 -19
  34. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/205/250/346/201/257/345/275/261/345/203/217.html +7 -17
  35. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/210/233/345/273/272/346/211/253/347/225/245.html +77 -85
  36. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/210/233/345/273/272/350/267/257/345/276/204.html +33 -35
  37. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/233/264/345/242/231/346/211/253/346/217/217/346/225/210/346/236/234.html +33 -37
  38. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/241/253/346/214/226/346/226/271/345/210/206/346/236/220.html +31 -36
  39. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/244/251/347/251/272/347/233/222/346/225/210/346/236/234.html +9 -19
  40. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/260/204/347/272/277/346/243/200/346/265/213.html +47 -52
  41. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/211/207/345/275/242/346/211/253/346/217/217/346/225/210/346/236/234.html +33 -33
  42. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/214/207/345/256/232/346/236/204/344/273/266/346/227/213/350/275/254.html +38 -40
  43. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/216/247/351/253/230/345/210/206/346/236/220/346/225/210/346/236/234.html +28 -29
  44. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/260/264/351/235/242/346/225/210/346/236/234.html +25 -27
  45. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/267/273/345/212/240/344/270/211/347/273/264/346/226/207/345/255/227.html +44 -22
  46. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/267/273/345/212/240/347/202/271/347/272/277/351/235/242/346/213/211/344/274/270/344/275/223.html +8 -18
  47. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//347/216/257/347/212/266/346/211/253/346/217/217/346/225/210/346/236/234.html +8 -18
  48. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//347/253/213/344/275/223/351/224/232/347/202/271.html +48 -53
  49. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//350/201/232/345/205/211/347/201/257/346/225/210/346/236/234.html +49 -32
  50. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//350/277/233/345/272/246/346/250/241/346/213/237-/346/214/211/344/273/273/346/204/217/346/226/271/345/220/221/345/211/226/345/210/207.html +265 -281
  51. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//351/200/232/350/247/206/345/210/206/346/236/220.html +35 -39
  52. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//351/233/252/345/244/251/346/225/210/346/236/234.html +20 -24
  53. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//345/244/232/346/236/204/344/273/266/345/211/226/345/210/207.html +80 -85
  54. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//345/256/232/344/275/215/346/236/204/344/273/266.html +96 -98
  55. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/345/261/236/346/200/247.html +27 -31
  56. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/347/242/260/346/222/236/346/243/200/346/265/213.html +93 -107
  57. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/351/200/211/346/213/251/344/270/216/345/256/232/344/275/215.html +50 -61
  58. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/351/232/220/350/227/217/343/200/201/346/236/204/344/273/266/345/274/272/350/260/203.html +124 -0
  59. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/351/232/224/347/246/273.html +127 -0
  60. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/216/267/345/217/226/346/236/204/344/273/266/345/214/205/345/233/264/347/233/222.html +48 -55
  61. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/256/276/347/275/256/346/250/241/345/236/213/351/242/234/350/211/262.html +65 -0
  62. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/256/276/347/275/256/351/200/217/346/230/216/345/272/246.html +100 -94
  63. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/256/276/347/275/256/351/232/224/347/246/273/346/240/267/345/274/217.html +93 -93
  64. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//351/232/220/350/227/217/346/236/204/344/273/266.html +63 -0
  65. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//351/242/234/350/211/262/346/214/211/351/222/256.html +110 -119
  66. package/docs/classes/{Animation.uvEffect.md → Animation.UvEffect.md} +10 -10
  67. package/docs/classes/Longan.CameraMouse.md +23 -7
  68. package/docs/classes/Longan.CameraPlanMouse.md +31 -11
  69. package/docs/classes/Longan.EarthCameraMouse.md +31 -11
  70. package/docs/classes/Longan.PanoramaCameraMouse.md +31 -11
  71. package/docs/classes/Longan.PerspectiveCameraMouse.md +31 -11
  72. package/docs/modules/Animation.md +1 -1
  73. package/lib/BimAir.common-report.html +2 -2
  74. package/lib/BimAir.common.js +10 -10
  75. package/lib/BimAir.css +41 -41
  76. package/lib/BimAir.umd-report.html +2 -2
  77. package/lib/BimAir.umd.js +10 -10
  78. package/lib/BimAir.umd.min-report.html +2 -2
  79. package/lib/BimAir.umd.min.js +10 -10
  80. package/lib/undefined.gzundefined +0 -0
  81. package/package.json +1 -1
  82. package/public/js/longan/longan.js +1013 -1019
  83. package/public/js/longan/longan.wasm +0 -0
  84. package/public/js/longan/longan.worker.js +43 -51
  85. package/public/js/longanWithoutShareArrayBuffer/longan.js +1 -1
  86. package/public/js/longanWithoutShareArrayBuffer/longan.wasm +0 -0
  87. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//351/242/234/350/211/262/345/222/214/345/212/250/347/224/273/346/214/211/351/222/256.html +0 -178
  88. package/demo//345/217/202/346/225/260/345/214/226/350/256/276/350/256/241//345/217/202/346/225/260/347/256/241/347/220/206/345/231/250.html +0 -86
  89. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/250/241/345/236/213/344/272/244/344/272/222-/345/212/240/350/275/275/345/244/232/346/250/241/345/236/213-/346/227/213/350/275/254/345/271/263/347/247/273/347/274/251/346/224/276.html +0 -155
  90. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/250/241/345/236/213/344/272/244/344/272/222-/345/244/232/346/250/241/345/236/213/346/223/215/344/275/234-/351/232/220/350/227/217/345/274/272/350/260/203.html +0 -156
  91. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/250/241/345/236/213/344/272/244/344/272/222-/350/256/276/347/275/256viewHouse.html +0 -122
  92. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//345/212/250/347/224/273-/345/273/272/347/255/221/346/210/277/345/261/213/350/277/233/345/272/246/346/250/241/346/213/237-/351/232/224/347/246/273/347/224/237/351/225/277.html +0 -118
  93. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//345/212/250/347/224/273-/346/226/275/345/267/245/350/277/233/345/272/246/346/250/241/346/213/237-/350/267/257/345/276/204/345/212/250/347/224/273/347/224/237/351/225/277.html +0 -493
  94. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//345/212/250/347/224/273-/347/256/241/350/267/257/350/277/233/345/272/246/346/250/241/346/213/237-/347/256/241/351/201/223/347/224/237/351/225/277.html +0 -172
  95. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//345/212/250/347/224/273-/350/207/252/345/256/232/344/271/211/347/256/241/351/201/223/350/277/233/345/272/246/346/250/241/346/213/237/346/226/271/345/220/221.html +0 -291
  96. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//350/267/257/345/276/204/345/271/263/347/247/273/345/212/250/347/224/273.html +0 -175
  97. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/250/241/345/236/213/346/223/215/344/275/234-/346/250/241/345/236/213/350/247/206/350/247/222-/346/212/225/345/275/261/346/226/271/345/274/217/345/217/230/346/215/242.html +0 -115
  98. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/250/241/345/236/213/346/223/215/344/275/234-/346/250/241/345/236/213/350/247/206/350/247/222-/350/216/267/345/217/226/347/233/270/346/234/272/345/217/202/346/225/260.html +0 -134
  99. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/250/241/345/236/213/346/223/215/344/275/234-/346/250/241/345/236/213/350/247/206/350/247/222-/351/224/201/345/256/232/347/233/270/346/234/272/350/247/206/350/247/222.html +0 -138
  100. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//350/256/276/347/275/256/345/267/245/345/205/267/346/240/217/344/270/216/346/214/211/351/222/256/346/230/276/347/244/272/351/232/220/350/227/217.html +0 -72
  101. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//350/256/276/347/275/256/347/233/270/346/234/272/347/212/266/346/200/201-/350/216/267/345/217/226/344/275/215/347/275/256/343/200/201/346/201/242/345/244/215/344/275/215/347/275/256.html +0 -137
  102. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//345/244/232/346/250/241/345/236/213/346/223/215/344/275/234-/346/236/204/344/273/266/351/232/220/350/227/217/343/200/201/346/236/204/344/273/266/345/274/272/350/260/203.html +0 -157
  103. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/346/223/215/344/275/234-/346/236/204/344/273/266/345/244/215/345/210/266-/344/277/256/346/224/271/351/242/234/350/211/262/343/200/201/346/236/204/344/273/266/351/232/224/347/246/273.html +0 -250
  104. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/346/223/215/344/275/234-/346/236/204/344/273/266/345/244/215/345/210/266-/346/236/204/344/273/266/351/232/220/350/227/217/343/200/201/350/267/257/345/276/204/345/212/250/347/224/273.html +0 -265
  105. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/250/241/345/236/213/344/277/241/346/201/257-/350/216/267/345/217/226/346/250/241/345/236/213/345/261/236/346/200/247/344/277/241/346/201/257-/346/236/204/344/273/266/345/261/236/346/200/247.html +0 -111
  106. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/250/241/345/236/213/346/236/204/344/273/266/351/232/224/347/246/273.html +0 -69
  107. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/216/267/345/217/226/346/236/204/344/273/266/344/277/241/346/201/257.html +0 -112
  108. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/216/267/345/217/226/346/250/241/345/236/213/347/273/223/346/236/204/346/240/221.html +0 -58
  109. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/256/276/347/275/256/346/236/204/344/273/266/351/242/234/350/211/262.html +0 -75
  110. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//351/232/220/350/227/217/344/270/211/347/273/264/346/250/241/345/236/213/346/236/204/344/273/266.html +0 -71
  111. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//351/232/224/347/246/273/346/214/211/351/222/256.html +0 -137
Binary file
@@ -34,7 +34,7 @@ if (ENVIRONMENT_IS_NODE) {
34
34
  },
35
35
  Worker: nodeWorkerThreads.Worker,
36
36
  importScripts: function(f) {
37
- (0, eval)(fs.readFileSync(f, 'utf8'));
37
+ (0, eval)(fs.readFileSync(f, 'utf8') + '//# sourceURL=' + f);
38
38
  },
39
39
  postMessage: function(msg) {
40
40
  parentPort.postMessage(msg);
@@ -50,10 +50,6 @@ if (ENVIRONMENT_IS_NODE) {
50
50
  // Thread-local guard variable for one-time init of the JS state
51
51
  var initializedJS = false;
52
52
 
53
- // Proxying queues that were notified before the thread started and need to be
54
- // executed as part of startup.
55
- var pendingNotifiedProxyingQueues = [];
56
-
57
53
  function threadPrintErr() {
58
54
  var text = Array.prototype.slice.call(arguments).join(' ');
59
55
  // See https://github.com/emscripten-core/emscripten/issues/14804
@@ -73,14 +69,14 @@ self.alert = threadAlert;
73
69
  Module['instantiateWasm'] = (info, receiveInstance) => {
74
70
  // Instantiate from the module posted from the main thread.
75
71
  // We can just use sync instantiation in the worker.
76
- var instance = new WebAssembly.Instance(Module['wasmModule'], info);
72
+ var module = Module['wasmModule'];
73
+ // We don't need the module anymore; new threads will be spawned from the main thread.
74
+ Module['wasmModule'] = null;
75
+ var instance = new WebAssembly.Instance(module, info);
77
76
  // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
78
77
  // the above line no longer optimizes out down to the following line.
79
78
  // When the regression is fixed, we can remove this if/else.
80
- receiveInstance(instance);
81
- // We don't need the module anymore; new threads will be spawned from the main thread.
82
- Module['wasmModule'] = null;
83
- return instance.exports;
79
+ return receiveInstance(instance);
84
80
  }
85
81
 
86
82
  // Turn unhandled rejected promises into errors so that the main thread will be
@@ -89,13 +85,37 @@ self.onunhandledrejection = (e) => {
89
85
  throw e.reason ?? e;
90
86
  };
91
87
 
92
- self.onmessage = (e) => {
88
+ function handleMessage(e) {
93
89
  try {
94
90
  if (e.data.cmd === 'load') { // Preload command that is called once per worker to parse and load the Emscripten code.
95
91
 
92
+ // Until we initialize the runtime, queue up any further incoming messages.
93
+ let messageQueue = [];
94
+ self.onmessage = (e) => messageQueue.push(e);
95
+
96
+ // And add a callback for when the runtime is initialized.
97
+ self.startWorker = (instance) => {
98
+ // Notify the main thread that this thread has loaded.
99
+ postMessage({ 'cmd': 'loaded' });
100
+ // Process any messages that were queued before the thread was ready.
101
+ for (let msg of messageQueue) {
102
+ handleMessage(msg);
103
+ }
104
+ // Restore the real message handler.
105
+ self.onmessage = handleMessage;
106
+ };
107
+
96
108
  // Module and memory were sent from main thread
97
109
  Module['wasmModule'] = e.data.wasmModule;
98
110
 
111
+ // Use `const` here to ensure that the variable is scoped only to
112
+ // that iteration, allowing safe reference from a closure.
113
+ for (const handler of e.data.handlers) {
114
+ Module[handler] = function() {
115
+ postMessage({ cmd: 'callHandler', handler, args: [...arguments] });
116
+ }
117
+ }
118
+
99
119
  Module['wasmMemory'] = e.data.wasmMemory;
100
120
 
101
121
  Module['buffer'] = Module['wasmMemory'].buffer;
@@ -110,36 +130,19 @@ self.onmessage = (e) => {
110
130
  URL.revokeObjectURL(objectUrl);
111
131
  }
112
132
  } else if (e.data.cmd === 'run') {
113
- // This worker was idle, and now should start executing its pthread entry
114
- // point.
115
- // performance.now() is specced to return a wallclock time in msecs since
116
- // that Web Worker/main thread launched. However for pthreads this can
117
- // cause subtle problems in emscripten_get_now() as this essentially
118
- // would measure time from pthread_create(), meaning that the clocks
119
- // between each threads would be wildly out of sync. Therefore sync all
120
- // pthreads to the clock on the main browser thread, so that different
121
- // threads see a somewhat coherent clock across each of them
122
- // (+/- 0.1msecs in testing).
123
- Module['__performance_now_clock_drift'] = performance.now() - e.data.time;
124
-
125
133
  // Pass the thread address to wasm to store it for fast access.
126
134
  Module['__emscripten_thread_init'](e.data.pthread_ptr, /*isMainBrowserThread=*/0, /*isMainRuntimeThread=*/0, /*canBlock=*/1);
127
135
 
136
+ // Await mailbox notifications with `Atomics.waitAsync` so we can start
137
+ // using the fast `Atomics.notify` notification path.
138
+ Module['__emscripten_thread_mailbox_await'](e.data.pthread_ptr);
139
+
128
140
  // Also call inside JS module to set up the stack frame for this pthread in JS module scope
129
141
  Module['establishStackSpace']();
130
142
  Module['PThread'].receiveObjectTransfer(e.data);
131
143
  Module['PThread'].threadInitTLS();
132
144
 
133
145
  if (!initializedJS) {
134
-
135
- // Execute any proxied work that came in before the thread was
136
- // initialized. Only do this once because it is only possible for
137
- // proxying notifications to arrive before thread initialization on
138
- // fresh workers.
139
- pendingNotifiedProxyingQueues.forEach(queue => {
140
- Module['executeNotifiedProxyingQueue'](queue);
141
- });
142
- pendingNotifiedProxyingQueues = [];
143
146
  initializedJS = true;
144
147
  }
145
148
 
@@ -147,20 +150,10 @@ self.onmessage = (e) => {
147
150
  Module['invokeEntryPoint'](e.data.start_routine, e.data.arg);
148
151
  } catch(ex) {
149
152
  if (ex != 'unwind') {
150
- // ExitStatus not present in MINIMAL_RUNTIME
151
- if (ex instanceof Module['ExitStatus']) {
152
- if (Module['keepRuntimeAlive']()) {
153
- } else {
154
- Module['__emscripten_thread_exit'](ex.status);
155
- }
156
- }
157
- else
158
- {
159
- // The pthread "crashed". Do not call `_emscripten_thread_exit` (which
160
- // would make this thread joinable. Instead, re-throw the exception
161
- // and let the top level handler propagate it back to the main thread.
162
- throw ex;
163
- }
153
+ // The pthread "crashed". Do not call `_emscripten_thread_exit` (which
154
+ // would make this thread joinable). Instead, re-throw the exception
155
+ // and let the top level handler propagate it back to the main thread.
156
+ throw ex;
164
157
  }
165
158
  }
166
159
  } else if (e.data.cmd === 'cancel') { // Main thread is asking for a pthread_cancel() on this thread.
@@ -169,12 +162,9 @@ self.onmessage = (e) => {
169
162
  }
170
163
  } else if (e.data.target === 'setimmediate') {
171
164
  // no-op
172
- } else if (e.data.cmd === 'processProxyingQueue') {
165
+ } else if (e.data.cmd === 'checkMailbox') {
173
166
  if (initializedJS) {
174
- Module['executeNotifiedProxyingQueue'](e.data.queue);
175
- } else {
176
- // Defer executing this queue until the runtime is initialized.
177
- pendingNotifiedProxyingQueues.push(e.data.queue);
167
+ Module['checkMailbox']();
178
168
  }
179
169
  } else if (e.data.cmd) {
180
170
  // The received message looks like something that should be handled by this message
@@ -191,4 +181,6 @@ self.onmessage = (e) => {
191
181
  }
192
182
  };
193
183
 
184
+ self.onmessage = handleMessage;
185
+
194
186