Commit 8f06a1d
authored
[SYCL] Add one more WA on Win for shutdown process (#19195)
WA for host task threads handling.
We must call join() or detach() on host task execution thread to avoid
UB.
DLLMain parameter lpReserved == NULL if library is unloaded via
FreeLibrary.
In this case we can't join threads within DllMain call due to global
loader lock
and DLL_THREAD_DETACH signalling.
lpReserved != NULL if library is unloaded during process termination. In
this case
Windows terminates threads but leave them in signalled state, prevents
DLL_THREAD_DETACH notification and we can call join() as NOP.
Note that FreeLibrary called with sycl RT handle does not guarantee
which path
will be used. Windows can (and actually does) simply postpone actual
unloading
till the end of program.
---------
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>1 parent cbb7dbe commit 8f06a1d
3 files changed
Lines changed: 64 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
| |||
366 | 369 | | |
367 | 370 | | |
368 | 371 | | |
369 | | - | |
370 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
| |||
428 | 433 | | |
429 | 434 | | |
430 | 435 | | |
431 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
432 | 444 | | |
433 | 445 | | |
434 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
35 | 59 | | |
36 | 60 | | |
37 | 61 | | |
38 | 62 | | |
39 | 63 | | |
40 | 64 | | |
41 | 65 | | |
42 | | - | |
43 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
44 | 72 | | |
45 | 73 | | |
46 | 74 | | |
| |||
76 | 104 | | |
77 | 105 | | |
78 | 106 | | |
79 | | - | |
| 107 | + | |
80 | 108 | | |
81 | 109 | | |
82 | 110 | | |
83 | 111 | | |
84 | 112 | | |
85 | 113 | | |
86 | | - | |
| 114 | + | |
87 | 115 | | |
88 | 116 | | |
89 | 117 | | |
90 | 118 | | |
91 | 119 | | |
92 | 120 | | |
93 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
94 | 134 | | |
95 | 135 | | |
96 | 136 | | |
| |||
0 commit comments